Position()

Summary

Returns the position of a substring within a string.

Syntax

location = Position(string big_string, string search_string)

Argument Contents
big_string The string to be searched
search_string The string for which to search

Returns

An integer indicating the position at which search_string starts in big_string, or zero if search_string is not found in big_string.

Example

pos = Position("The Quick Brown Fox", "Quick") // returns 5
pos = Position("The Quick Brown Fox", "Fred") // returns 0

See Also

Function Summary
Left() Returns the leftmost n characters of a string
Right() Returns the rightmost n characters of a string
PositionFrom() Search for the first occurrence of a substring within a string, starting the search at a designated position
PositionTo() Search for the last occurrence of a substring within a string, ending the search at a designated position
StringLength() Returns the length of a string
Substitute() Replaces a matching substring with a new string.
SubstituteChars() Returns the input string with all occurrences of the characters listed in the find string replaced with the characters in the replacement string
Substring() Extracts a portion of a string