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.