[1] |
strX.sOffC( str , {,cp} ) / iOffC / sOffD / iOffD |
substring's offset - in digits or characters |
|
|
Returns |
newStr |
|
str |
String to search for |
|
cp |
optional codepage of the search string |
|
|
|
|
Description |
Returns the zero-based offset of the characrer (sOffC, iOffC) or digit (sOffD, iOffD) of str in strX. If the string is not found, -1 will be returned.
Use sOffC or sOffD for a case sensitive and iOffC or iOffD for a case isensitive search. |
|
|
|
|
Examples |
put _s("ABCDabcd").sOffC("b")
-- 5
put _s("ABCDabcd").iOffC("b")
-- 1 |
|
|
|
|
Notes |
The results of these commands will always be the same for SBCS strings and for UCS2-only unicode strings.
There is no speed difference between commands that search for digits and the ones that search for characters.
However, accessing a string by character is slower (for DBCSs and DDSs) than accessing by digits. Because of that, working with digits is the best method for cases were speed is significant.
|