Kaya 0.5.2 reference for Strings::firstOccurs

List of functions and data types in Strings

Int firstOccurs(Char c, String str)

Arguments

Usage

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

str = "abcdefgabcde";
i = firstOccurs('a',str); // i = 0
i = firstOccurs('d',str); // i = 3
i = firstOccurs('h',str); // i = 12

Related

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