FSm
FSm

Reputation: 2057

Array of Array into one array c#

I'm trying to convert

string[][] allcats

into 

string[] ToOneArray 

Can any help or suggestion for fast Linq way please ?? many Thanks

Upvotes: 1

Views: 136

Answers (1)

Sergey Kalinichenko
Sergey Kalinichenko

Reputation: 726987

I want to combine each element of allcats into single string, then map it into one array

Try this:

var res = allcats.Select(a => string.Join("", a)).ToArray();

Upvotes: 5

Related Questions