HTML Utilities

Showing help on 'rindex()'

Syntax: index (STR <str1>, STR <str2> [, <case-matters>]) => INT
rindex (STR <str1>, STR <str2> [, <case-matters>]) => INT

The function `index()' (`rindex()') returns the index of the first character of the first (last) occurrence of <str2> in <str1>, or zero if <str2> does not occur in <str1> at all. By default the search for an occurrence of <str2> is done while ignoring the upper/lower case distinction. If <case-matters> is provided and true, then case is treated as significant in all comparisons.

index("foobar", "o") => 2
rindex("foobar", "o") => 3
index("foobar", "x") => 0
index("foobar", "oba") => 3
index("Foobar", "foo", 1) => 0



-- telnet://project-mongoose.net:7777 -- Mail us -- http://project-mongoose.net:7780/ --
-- Five users connected --