Найти количество слов, начинающихся на букву "а", не учитывая регистр - C#
Формулировка задачи:
Дана строка. Найти количество слов начинающихся на букву "а" (русскую или английскую не важно), не учитывая регистр. Помогите много пересмотрел так и выводит почему-то 0.
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication11
{
class Program
{
public class SplitTest
{
public static void Main()
{
string words = System.IO.File.ReadAllText(@"C:\Documents and Settings\Admin\Рабочий стол\еуч.txt");
string[] split = words.Split(new Char[] {' '}, StringSplitOptions.RemoveEmptyEntries);
int count = 0;
foreach (string s in split)
{
if (char.ToLower(s[0])=='а'||char.ToLower(s[0])=='А')
count++;
}
Console.WriteLine(count);
Console.Read();
}
}
}
}Решение задачи: «Найти количество слов, начинающихся на букву "а", не учитывая регистр»
textual
Листинг программы
for (int index = 0; index < words.Length; index++)
{
if (words[index] == ',' || и т.д.)
{
words = words.Remove(index, 1);
index--;
}
}