how to split string into a list ignoring number of spaces c#

64

how to split string into a list ignoring number of spaces c# -

using System;

var text = "There  is an old  hawk in the sky";

var words = text.Split(' ', StringSplitOptions.RemoveEmptyEntries);
Array.ForEach(words, Console.WriteLine);

Comments

Submit
0 Comments