Kaya 0.5.3 reference for Strings::firstOccurs

List of functions and data types in Strings

Int firstOccurs(String needle, String haystack)

Arguments

Usage

Returns the position of the first occurence of the needle substring in the haystack string (or the length of the string if the substring is not in the string).

str = "abcdefgabcde";
i = firstOccurs("ab",str); // i = 0
i = firstOccurs("de",str); // i = 3
i = firstOccurs("efa",str); // i = 12

Related

kaya@kayalang.org | Last modified 29 November 2011 | Supported by Durham CompSoc | Powered by Kaya