string letters = "abcdefghijklmabcdefghijklm";
string output = "";
char[] searchLetters = { 'c', 'a', '$' };
// test LastIndexOfAny to find last occurrence of character in array
output += "\n\nLast occurrence of 'c', 'a' or '$' is " + "located at " + letters.LastIndexOfAny( searchLetters );
output += "\nLast occurrence of 'c', 'a' or '$' is " + "located at " + letters.LastIndexOfAny( searchLetters, 1 );
output += "\nLast occurrence of 'c', 'a' or '$' is " + "located at " + letters.LastIndexOfAny(searchLetters, 25, 5 );
System.Console.WriteLine(output);
