offset | |||||||||||||
Type | function | ||||||||||||
Dictionary | LCS | ||||||||||||
Library | LiveCode Script | ||||||||||||
Syntax |
| ||||||||||||
Summary | Returns the number of characters between the first character of a value and an occurrence of a specified string. | ||||||||||||
Introduced | 1.0 | ||||||||||||
OS | mac, windows, linux, ios, android | ||||||||||||
Platforms | desktop, server, mobile | ||||||||||||
Parameters |
| ||||||||||||
Example |
| ||||||||||||
Values |
| ||||||||||||
Related | Property: caseSensitive Operator: begins with Keyword: character, characters, integer, string, point Control Structure: function Function: wordOffset, itemOffset, length, lineOffset, value Command: find, sort container Glossary: return, non-negative, property | ||||||||||||
Description | Use the offset function to find where a string occurs in another string. The value returned by the offset function is the number of the character where charsToFind appears in stringToSearch. If the charsToFind is not in stringToSearch, the offset function returns zero. If the charsToFind contains more than one character, and the entire charsToFind appears in the stringToSearch, the offset function returns the character number where the charsToFind starts. If you specify how many charsToSkip, the offset function skips the specified number of characters in the stringToSearch. The value returned is relative to this starting point instead of the beginning of the stringToSearch.
| ||||||||||||
Tags | text processing |