Hi
I need help in extracting only words into a list or array from a multi-line string.
My input example looks as follows:
This is test string
Second Line String
Third line string
I can have multiple spaces if I split on the basis of space the extra space is being considered as a character which not a desired for me. Following is the expected output
Output:
This
is
a
test
string
Second
Line
String
Third
Line
String
I tried regex.replace(input,“\s*[2,]”," "). This is not replacing my input string extra spaces.
Any regex that can replace 2 or more spaces with a single space can work or a LINQ that gives me only words eliminating extra spaces can help.