String.Join Method (String, IEnumerable(String))
Assembly: mscorlib (in mscorlib.dll)
[<ComVisibleAttribute(false)>] static member Join : separator:string * values:IEnumerable<string> -> string
- Type: System.String
The string to use as a separator. separator is included in the returned string only if values has more than one element.
values is a null reference (Nothing in Visual Basic).
If separator is a null reference (Nothing in Visual Basic), an empty string (String.Empty) is used instead. If any member of values is a null reference (Nothing in Visual Basic), an empty string is used instead.
is a convenience method that lets you concatenate each element in an IEnumerable(Of String) collection without first converting the elements to a string array. It is particularly useful with Language-Integrated Query (LINQ) query expressions. The following example passes a List(Of String) object that contains either the uppercase or lowercase letters of the alphabet to a lambda expression that selects letters that are equal to or greater than a particular letter (which, in the example, is "M"). The IEnumerable(Of String) collection returned by the Enumerable.Where method is passed to the method to display the result as a single string.
The following example uses the Sieve of Eratosthenes algorithm to calculate the prime numbers that are less than or equal to 100. It assigns the result to a List(T) object of type String, which it then passes to the method.
.NET FrameworkSupported in: 4.5, 4
.NET Framework Client ProfileSupported in: 4
Portable Class LibrarySupported in: Portable Class Library
.NET for Windows Store appsSupported in: Windows 8
.NET for Windows Phone appsSupported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)