1

I'm trying to convert

string[][] allcats

into 

string[] ToOneArray 

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

0

1 Answer 1

5

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();
Sign up to request clarification or add additional context in comments.

4 Comments

@dasblinkenlight......Does this code will combine each element of allcats into single string ??
@Qaesar No, it will put separate strings into a single array, one by one. Here is a link to a demo at ideone.
@Qaesar: No, into a single string[]. You can use string.Join to make everything into single string.
@dasblinkenlight... But I want to combine each element of allcats into single string, then map it into ToOneArray

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.