This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| functions:strfind [2017/03/20 07:57] – korshun | functions:strfind [2020/12/24 11:12] (current) – [Examples] monsterovich | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| Returns the position of the first occurence of what in s. If the string is not present, returns -1. | Returns the position of the first occurence of what in s. If the string is not present, returns -1. | ||
| + | <note tip>To search for the **last** occurence, use [[StrRFind]].</ | ||
| ===== Examples ===== | ===== Examples ===== | ||
| Line 12: | Line 12: | ||
| StrFind(" | StrFind(" | ||
| StrFind(" | StrFind(" | ||
| + | StrFind(" | ||
| StrFind(" | StrFind(" | ||
| - | StrFind(" | + | StrFind(" |
| + | StrFind("", | ||
| </ | </ | ||
| Line 20: | Line 22: | ||
| if (index != -1) | if (index != -1) | ||
| print(s:" | print(s:" | ||
| - | else: | + | else |
| print(s:" | print(s:" | ||
| </ | </ | ||
| + | ===== See also ===== | ||
| + | * [[StrRFind]] | ||
| + | * [[StrFindFrom]] | ||
| + | * [[StrRFindFrom]] | ||