Find substring |
![]() |
|
|
|
|
|
|
|
|
|
|
Find will search the string, starting at the given 0-based position (by default, the beginning of the string) and return the index of the first occurrence of the given substring. It performs a case-sensitive search. If the string cannot be found, the method returns -1.
If the startat parameter is beyond the end of the string, Str will throw an exception.
FindNoCase is exactly the same, but will do a case-insensitive search. It is somewhat slower, especially on big strings, so if you need to call it repeatedly in a performance-critical function, it is best to first produce a lowercase copy of the string object and of substr, and use Find() instead.
See also: Find, Replace, Compare