isearch

Return the index position of a text pattern within src, or src.length upon failure.

This is a case-insensitive search (with thanks to Nietsnie)

isearch
(
in char[] src
,
in char[] pattern
)

Examples

char[20] tmp;

assert (toLower("1bac", tmp) == "1bac");
assert (toLower("1BAC", tmp) == "1bac");
assert (toUpper("1bac", tmp) == "1BAC");
assert (toUpper("1BAC", tmp) == "1BAC");
assert (icompare ("ABC", "abc") is 0);
assert (icompare ("abc", "abc") is 0);
assert (icompare ("abcd", "abc") > 0);
assert (icompare ("abc", "abcd") < 0);
assert (icompare ("ACC", "abc") > 0);

assert (isearch ("ACC", "abc") is 3);
assert (isearch ("ACC", "acc") is 0);
assert (isearch ("aACC", "acc") is 1);

Meta