====== strfind ======
===== Description =====
Find the position of a substring within a text string.
===== Function prototype =====
int strfind
===== Arguments =====
^ Name ^ Type ^ Comment ^
| //Text// | string | A text string. |
| //TextToFind// | string | A substring, the position of which in //Text// is to be found. |
| //StartAt// | int | The zero-based starting position in //Text// to begin looking for //TextToFind//. Default is 0. |
===== Return value =====
An integer containing the position of the start of //TextToFind// in //Text//. Position indices are zero based.
If //TextToFind// is not found in //Text// at or after the position given by //StartAt//, -1 is returned.
===== Example =====
// find the position of "test" in "This is a test" (ans:10)
echo
... the output of which is written to the event log by [[plugins:general:zeoscript:reference:functions:echo]] as:
10
===== Comments =====
==== Case sensitivity ====
''strfind'' is case sensitive. For a case-insensitive find, use [[strupper]] or [[strlower]] to convert both the //Text// and //TextToFind// arguments to either upper case or lower case.
===== See also =====
* [[plugins:general:zeoscript:reference:functions:strreplace]]