Int firstOccurs(String needle, String haystack)
Arguments
needle: The string to check forhaystack: The string to check
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