HELP ISSUBSTRING_LIM                                   A.Sloman Oct 1990

    issubstring_lim(string1, index, start_limit, end_limit, string2)
        -> integer or false

ISSUBSTRING_LIM takes a string (or word) STRING1, three integer
arguments INDEX, START_LIMIT and END_LIMIT and a second string (or word)
STRING2 and returns either <false> or an integer.  The arguments
START_LIMIT and END_LIMIT may optionally be false.

Starting from location INDEX in STRING2, it looks for an occurrence of
STRING1 in STRING2 satisfying the constraints defined by START_LIMIT and
END_LIMIT (explained below). If it finds such an occurrence then it
returns the index into STRING2 at which STRING1 begins. If there is more
than one, it returns the index corresponding to the first such
occurrence.

The constraints on the occurrence of STRING1 are as follows:

    1. It must start at or after location INDEX in STRING2.

    2. If START_LIMIT is an integer then it must start at or before
       location START_LIMIT in STRING2.

    3. If END_LIMIT is an integer then the occurence must end on or
       before that location in STRING2.

If no occurrence of STRING1 in STRING2 satisfies these constraints, then
FALSE is returned.


--- Examples -----------------------------------------------------------

    ;;; does 'the' occur in the string or or after character 1 ?
    issubstring_lim('the', 1, false, false, 'all the cats')=>
    ** 5

    ;;; does it occur on or after character 6 ?
    issubstring_lim('the', 6, false, false, 'all the cats') =>
    ** <false>

    ;;; does it start between characters 1 and 5 inclusive?
    issubstring_lim('the', 1, 5, false, 'all the cats') =>
    ** 5

    ;;; does it start between characters 1, and 4 ?
    issubstring_lim('the', 1, 4, false, 'all the cats') =>
    ** <false>

    ;;; does 'the' finish on or before the 7th character?
    issubstring_lim('the', 1, false, 7, 'all the cats') =>
    ** 5

    ;;; does 'the' finish on or before the 6th character?
    issubstring_lim('the', 1, false, 6, 'all the cats') =>
    ** <false>

    issubstring_lim('the', 1, 5, 7, 'all the cats')=>
    ** 5

    issubstring_lim("hat", 1, false, false, "thatch") =>
    ** 2

See also

HELP * ISSUBSTRING,  * ISSTARTSTRING,  * ISENDSTRING,  * ISMIDSTRING
     * HASSUBSTRING, * HASSTARTSTRING, * HASENDSTRING, * HASMIDSTRING,
     * SUBSTRING,    * LOCCHAR,        * LOCCHAR_BACK, * SKIPCHAR,
     * SKIPCHAR_BACK * STRMEMBER,      * STRINGS

--- C.all/help/issubstring_lim
--- Copyright University of Sussex 1990. All rights reserved. ----------
