How to split a string with more than one whitespaces as delimiters?
c#, string
Solution
Split on two spaces, then trim any excess you might get in your results (would occur if you have an odd number of spaces)
List<string> splitStrings = myString.Split(new[]{" "}, StringSplitOptions.RemoveEmptyEntries)
.Select(s => s.Trim())
.ToList();
Problem
I have strings where one whitespace must not be a delimiter. But when more than one whitespaces occur consecetively, it must act as delimiter. e.g. ``` "Line 1 Component Name Revision Quantity Unit" ``` Here in this example I must have 5 different elements after split. How can I implement it with built-in split function in string. (please note that single occurence of whitespace do not act as delimiter)