0

Can you tell me an easy way to make a string from array of string?

I have:

String line = "how are you";
string[] split = line.Split(new Char[] { ' ' }); //{"how", "are", "you"}

How i can make back "String - How are you"? IT IS ONLY EXAMPLE, NOT REALITY :-) Thank you.

1 Answer 1

11

Use this:

string.Join(" ", split);
Sign up to request clarification or add additional context in comments.

4 Comments

Thank you very much, and if i need make a this string = '"are you"' without 'split[0]'?
@coudrouf string.Join(" ", split.Skip(1));
Thank you, its possible skip index number X ?
Sure. string.Join(" ", split.Where((s, x) => x != 1));

Your Answer

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