CharOffsetAfter

Typeoperator
DictionaryLCB
LibraryLiveCode Builder
Syntax
the ( first | last ) offset of <Needle> after <After> in <Target>
Associationscom.livecode.char
Summary

Finds the first or last occurrence of Needle after a specified index in Target

Parameters
NameTypeDescription
Needle

An expression which evaluates to a string.

Target

An expression which evaluates to a string.

After

An expression which evaluates to a valid integer index of Target.

Example
variable tVar as Number
put the offset of "nse" after 4 in "nonsense" into tVar -- tVar contains 2
Values
NameTypeDescription
return

Returns the offset of Needle after After in Target.

Description

The first (respectively last) offset of Needle in Target is number of chars between the first char of the substring of Target beginning at char After + 1, and the first (respectively last) occurrence of Needle in the substring. If neither first or last is specified, then the first offset is found. If Needle does not occur in the given substring of Target, then the output is 0.

Tagsstrings