Find Function
- 已更新2025-07-21
- 閱讀時間為 1 分鐘
Find Function
Syntax
Number Find(String string, String stringToSearchFor, Number indexToSearchFrom = 0, Boolean ignoreCase = False, Boolean searchInReverse = False)
Return Value
The zero-based character index, starting at the beginning of the string, of the first character in the substring. The function returns -1 if it does not find the substring.
Purpose
This function searches a string for a substring.
Parameters
string as String
A string.
stringToSearchFor as String
The substring to find.
indexToSearchFrom as Number
(Optional) the zero-based character index at which to begin searching. The default is 0.
ignoreCase as Boolean
(Optional) Pass True to ignore character case when searching. The default is False.
searchInReverse as Boolean
(Optional) Pass True to search the string in reverse. The default is False. If you search in reverse, the index to search from that you pass to parameter 3 is zero-based with respect to the last character in the string. The return value remains zero-based with respect to the first character in the original non-reversed string.