Reputation: 3615
I have a array of string in following format.
string[] sports = { "Cricket" , "Football" ,"Boxing/Tennis " , "Soccer"} ;
Is there any built in way in C# or using LINQ to split strings in array and return new array like
string[] sportsNewArray = { "Cricket" , "Football" ,"Boxing" , "Tenis " , "Soccer"} ;
Upvotes: 1
Views: 1712
Reputation: 15663
string[] sportsNewArray = sports.SelectMany(s=>s.Split('/')).ToArray();
Upvotes: 11