private static IEnumerable<int> AllIndicesOf(string s, char c) { for (int i = 0; i < s.Length; i++) { if (s[i] == c) { yield return i; } } }