NAnt
![]() ![]() ![]() |
v0.85 |
[This is preliminary documentation and subject to change.]
Returns the position of the last occurrence in the specified string of the given search string.
string::last-index-of(str, substr)
Name | Type | Description |
---|---|---|
str | string | input string |
substr | string | search string |
The highest-index position of substr in str if it is found, or -1 if str does not contain substr.
If substr is an empty string, the return value is the last index position in str.
string::last-index-of('testing string', 'test') ==> 0
string::last-index-of('testing string', '') ==> 0
string::last-index-of('testing string', 'Test') ==> -1
string::last-index-of('testing string', 'ing') ==> 4