I’m using the following regex:
documentText = Regex.Replace(documentText, "\\\\|\\^|\\+|\\*|~|#|=|\"", "");
and it works. But when I split this string by using:
wordsInText = documentText.ToLower().Split(' ').ToList();
I get elements that are marked as "" (empty string). I can remove it manually by iterating through collection and removing empty elements, but it must be a way to prevent this weird behaviour.
1 Answer