diff --git a/Lab4.FirstEqualLast/TaskUtils.cs b/Lab4.FirstEqualLast/TaskUtils.cs index af0fe1d..87945c6 100644 --- a/Lab4.FirstEqualLast/TaskUtils.cs +++ b/Lab4.FirstEqualLast/TaskUtils.cs @@ -27,7 +27,7 @@ namespace Lab4.FirstEqualLast @param punctuation – punctuation marks to separate words */ private static int FirstEqualLast (string line, string punctuation) { - string[] parts = Regex.Split(line, punctuation); + string[] parts = Regex.Split(line.ToLower(), punctuation); int equal = 0; foreach (string word in parts) if(word.Length > 0) // empty words at the end of line @@ -56,8 +56,7 @@ namespace Lab4.FirstEqualLast @param punctuation – punctuation marks to separate words */ private static int FirstEqualLast (string line, char[] punctuation) { - string[] parts = line.Split(punctuation, - StringSplitOptions.RemoveEmptyEntries); + string[] parts = line.ToLower().Split(punctuation, StringSplitOptions.RemoveEmptyEntries); int equal = 0; foreach (string word in parts) if (word[0] == word[word.Length - 1]) diff --git a/Lab4.RemoveComments/Program.cs b/Lab4.RemoveComments/Program.cs index 5e8d41e..f789a14 100644 --- a/Lab4.RemoveComments/Program.cs +++ b/Lab4.RemoveComments/Program.cs @@ -1,4 +1,5 @@ -using System; +using System; +using System.Text.RegularExpressions; namespace Lab4.RemoveComments {