code_junkie

What's the C# method/syntax for converting an array to a simple string?

Nov 11th, 2011
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. char sep = GetSeparatorChar();
  2. object[] toJoin = GetToJoin();
  3. string joined = toJoin.Aggregate((x,y) => x.ToString()+sep.ToString()+y.ToString());
  4.  
  5. char sep = GetSeparatorChar();
  6. string[] toJoin = GetToJoin();
  7. string joined = toJoin.Aggregate((x,y) => x+sep.ToString()+y);
Add Comment
Please, Sign In to add comment