NAnt
Help
Function Reference
string::index-of |
v0.85-nightly-2005-11-09 |
[This is preliminary documentation and subject to change.]
Returns the position of the first occurrence in the specified string of the given search string.
int string::index-of(source, value)
| Name | Type | Description |
|---|---|---|
| source | string | The string to search. |
| value | string | The string to locate within source. |
The lowest-index position of value in source if it is found, or -1 if source does not contain value.
If value is an empty string, the return value will always be 0.
string::index-of('testing string', 'test') ==> 0string::index-of('testing string', '') ==> 0string::index-of('testing string', 'Test') ==> -1string::index-of('testing string', 'ing') ==> 4