String Join C# | C# join string - c# - c# tutorial - c# net
C# Join String - c# examples - c# programs
What is C# join string ?
- The join string() method combines many strings into one. The join string receives two arguments, such as:
- An array of IEnumerable and
- A separator string.
- It places the separator between every element of the collection in the returned string.
C# join string
Syntax:
C# Sample Code - C# Examples:
Code Explanation:
- In this example we combine string elements from an array into a new, single string (string[] strjoin = new string[]) with dividing 3 characters (Welcome to wikitechy web site","www.wikitechy.com","This is string join Method"). This example will produce the output with separating commas.
- Here we use the string.Join method to combine a List of strings into one string.
- It Writes the string representation of the specified str object, followed by the current line terminator, to the standard output stream using the specified format information.
Sample C# examples - Output :
- Here in this output we display "welcome to wikitechy website" which specifies to new string array with first elements.
- In this output we display www.wikitechy.com which specifies to new string array with second elements.
- In this output we display "This is string join Method" which specifies to new string array with third elements.