Published in: C#
private static List<string> stringToWordArray(string s) { string word; s = s.ToUpper(); s = s.Trim(',', '.', '"', '-', ' ', ':', ';', '\n', '!', '?'); while (s.Length > 0) { if (s.Contains(' ')) { word = s.Substring(0, s.IndexOf(" ")); s = s.Substring(s.IndexOf(" ") + 1); s = s.Trim(); } else { word = s; s = ""; } word = word.Trim(',', '.', '"', '-', ' ', ':', ';', '\n', '!', '?'); if (word.Length > 0) words.Add(word); else return words; } return words; }
You need to login to post a comment.
