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
Security Picture

Photos
Me in MSDN Forums
-   Answered the question How can i get it in the Visual C# General forum
-   Answered the question How to add the VAT to the ammount in the Visual Basic General forum
-   Contributed a proposed answer to the question How to add the VAT to the ammount in the Visual Basic General forum
-   Replied to the question How can i get it in the Visual C# General forum
-   Replied to the question How to add the VAT to the ammount in the Visual Basic General forum
-   Answered the question How to show ToolStripMenuItem's hot key? in the Windows Forms General forum
-   Contributed a proposed answer to the question How to show ToolStripMenuItem's hot key? in the Windows Forms General forum
-   Answered the question Expert to Excel Missing Some Data In Grid View in the Visual C# Language forum
-   Contributed a helpful post (total votes:1) to the forums thread Expert to Excel Missing Some Data In Grid View in the Visual C# Language forum
-   Replied to the question How to show ToolStripMenuItem's hot key? in the Windows Forms General forum
Entries
News
Articles