FindOneOf() 用于搜索字符串,以便从一组提供的字符中找到任意字符出现的位置。The position of the first occurrence of any character from the search set is returned unless a third argument (with a value greater than 1) is supplied.如果未找到匹配值,则返回 0。
语法:
FindOneOf(text, char_set[, count])
返回数据类型: 整数
参数:
参数
参数
说明
text
原始字符串。
char_set
在 text 中搜索的字符集。
count
定义搜索哪一次出现的任何字符。例如,值为 2,则搜索第二次出现的。
Example
Result
FindOneOf( 'my example text string', 'et%s')
Returns '4' because ‘e’ is the fourth character in the example string.
FindOneOf( 'my example text string', 'et%s', 3)
Returns '12' because the search is for any of the characters e, t, % or s, and "t" is the third occurrence in position 12 of the example string.
FindOneOf( 'my example text string', '¤%&')
Returns '0' because none of the characters ¤, %, or & exist in the example string.