1Strings.firstOccurs(3kaya) Kaya module reference Strings.firstOccurs(3kaya)
2
3
4
6 Strings::firstOccurs - Return the position of the first occurence of a
7 character
8
10 Int firstOccurs( Char c, String str )
11
13 c The character to check for
14
15 str The string to check
16
18 Returns the position of the first occurence of the character in the
19 string (or the length of the string if the character is not in the
20 string).
21
22
23 str = "abcdefgabcde";
24 i = firstOccurs('a',str); // i = 0
25 i = firstOccurs('d',str); // i = 3
26 i = firstOccurs('h',str); // i = 12
27
29 Kaya standard library by Edwin Brady, Chris Morris and others
30 (kaya@kayalang.org). For further information see http://kayalang.org/
31
33 The Kaya standard library is free software; you can redistribute it
34 and/or modify it under the terms of the GNU Lesser General Public
35 License (version 2.1 or any later version) as published by the Free
36 Software Foundation.
37
39 Strings.elem (3kaya)
40 Strings.firstOccurs_1 (3kaya)
41
42
43
44Kaya December 2010 Strings.firstOccurs(3kaya)