Error getting tags :
error 404Error getting tags :
error 404 offset | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
offset
Basics
Expander triangle
Type
Function
Syntax
offset(charsToFind,stringToSearch[,charsToSkip])
Introduced
1.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
None required
Summary
Returns the number of characters between the first character of a value and an occurrence of a specified string.
Examples

offset("c","abcde") -- returns 3
offset("b","abacadabra",2) -- returns 63) -- returns 3) -- returns 3) -- returns 3

Additional Comments
Expander triangle

Use the offset function to find where a string occurs in another string.

Parameters:

The charsToFind is a string or an expression that evaluates to a string.

The stringToSearch is a string or an expression that evaluates to a string.

The charsToSkip is a non-negative integer. If you don't specify how many charsToSkip, the offset function does not skip any items and starts at the beginning of the stringToSearch.

Value:

The offset function returns a non-negative integer.

Comments:

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.

User Comments
Expander triangle