Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

String::Concat Method (IEnumerable<String>)

Concatenates the members of a constructed IEnumerable<T> collection of type String.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

[ComVisibleAttribute(false)]
public:
static String^ Concat(
	IEnumerable<String^>^ values
)

Parameters

values
Type: System.Collections.Generic::IEnumerable<String>

A collection object that implements IEnumerable<T> and whose generic type argument is String.

Return Value

Type: System::String
The concatenated strings in values.

ExceptionCondition
ArgumentNullException

values is nullptr.

The method concatenates each object in values; it does not add any delimiters. To specify a delimiter between each member of values, call the Join(String, IEnumerable<String>) method.

An Empty string is used in place of any null argument.

Concat(IEnumerable<String>) 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 that is returned by the Enumerable::Where method is passed to the Concat(IEnumerable<String>) method to display the result as a single string.

No code example is currently available or this language may not be supported.

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 Concat(IEnumerable<String>) method.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone 8, Silverlight 8.1

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)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft