Türkçe   |   English
Calendar
Categories
Archive
Links
Blogroll
Files

String.Join - 02.12.2009

It's easy to produce a string output of an array of strings in our applications. But it's even easier with the String.Join function:

string[] arr = new string[3];

arr[0] = "a";
arr[1] = "b";
arr[2] = "c";

string joined = String.Join("|", arr);
MessageBox.Show(joined);

This code will return an output of "a|b|c"

This overload takes the seperator as the first parameter and string array as the second parameter.

Code

Add Comment
First Name Last Name
Web Site
E-Mail
Comment

Photos
Me in MSDN Forums
Entries
News
Articles