How to check if a word starts with a given character?

To check one value, use: string word = “Aword”; if (word.StartsWith(“A”)) { // do something } You can make a little extension method to pass a list with A, B, and C public static bool StartsWithAny(this string source, IEnumerable<string> strings) { foreach (var valueToCheck in strings) { if (source.StartsWith(valueToCheck)) { return true; } } return … Read more