I have seen several similar questions, but I am trying to achieve this.
Given the string, str = "The moon is our natural satellite, that is, it revolves around the Earth!" I want to extract words and store them in an array. Expected array elements will be like this.
the moon is our natural satellite ie it rotates around the earth
I tried using String.split (',' \ t ',' \ r '), but this does not work correctly. I also tried uninstalling. And other punctuation marks, but I need a string like "ie" can also be parsed. What is the best way to achieve this? I also tried using regex.split to no avail.
string[] words = Regex.Split(line, @"\W+");
Of course, appreciate some boosts in the right direction.
split c # regex words
Richard N
source share