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