Difference between revisions of "NXSL:index"
Jump to navigation
Jump to search
(Initial version) |
m (Text replacement - "^" to "{{deprecated}}") |
||
Line 1: | Line 1: | ||
__NOTOC__ | {{deprecated}}__NOTOC__ | ||
Returns the position of the first occurrence of ''substring'' in ''string'' at or after ''position'' if specifed. | Returns the position of the first occurrence of ''substring'' in ''string'' at or after ''position'' if specifed. | ||
Latest revision as of 18:13, 13 September 2022
This Wiki is deprecated and we are are currrently migrating remaining pages into product documentation (Admin Guide, NXSL Guide) |
Returns the position of the first occurrence of substring in string at or after position if specifed.
Syntax
index(string, substring [,position]);
Parameters
string | The string which will be examined. |
substring | The string which we will search for. |
position | [Optional] The starting position in the string to begin our search from the left. |
All index values are 1-based (i.e. the first character has index 1, not 0).
Return Value
Integer value of the position substring was found at, will return 0 if not found.
Examples
index("abcdef","cd") -> 3 index("abcdef","cd",4) -> 0 index("abcdefabcdef","cd",4) -> 9