Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
ezeio2:scriptref:strfind [2019-06-15 18:52] – created andreh | ezeio2:scriptref:strfind [2019-09-02 21:43] (current) – andreh | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Script reference ====== | + | ==== strfind ==== |
- | + | ||
- | ==== strfind( string[], sub[], ignorecase=false, | + | |
Searches a string for a substring | Searches a string for a substring | ||
Line 22: | Line 20: | ||
Returns the offset of '' | Returns the offset of '' | ||
Returns -1 if no occurrence of '' | Returns -1 if no occurrence of '' | ||
+ | |||
+ | The returned offset is always relative to the start of the '' | ||
=== Example usage === | === Example usage === | ||
<code javascript> | <code javascript> | ||
+ | new x; | ||
new s{20} = " | new s{20} = " | ||
| | ||
- | | + | |
- | // s is now " | + | // x is now 3 |
</ | </ | ||