Functions

trInstr

Supported By

Syntax

[the] trInstr of ( haystack , needle )

trInstr ( haystack , needle )

Haystack yields any string. Needle yields a string describing a set of characters.

Description

The trInstr function returns the index of the first appearance of any of the characters in needle in the string haystack, starting at 1. If none of the characters in needle can be found in haystack, zero is returned.

Needle describes a set of characters, not a string. A range of characters can be specified by putting a hyphen between two characters; to match a literal hyphen, put a hyphen at the beginning or end. For example, the following pattern matches all numbers and basic Latin letters, as well as hyphens: A-Za-z0-9-

Note

This function is similar to trOffset, but the arguments are in reverse order.

See Also

regInstr, regOffset, trOffset, regRinstr, trRinstr