Returns the index of "substr" inside of "string" starting at the specified start index.
"string" - the string to search.
"substr" - the substring to search for.
start - the position from which to begin the search (default is 0)
A scalar integer with the index. A failed search will return $null.
$string = "this is a test"; $start = 0; while $index (indexOf($string, " ", $start)) { println("$start $+ : $+ $index " . substr($string, $start, $index)); $start = $index + 1; } println("$start $+ :end " . substr($string, $start));
0:4 this 5:7 is 8:9 a 10:end test