String::Concat Method (IEnumerable<String^>^)
Concatenates the members of a constructed IEnumerable<T> collection of type String.
Assembly: mscorlib (in mscorlib.dll)
public: [ComVisibleAttribute(false)] 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, or String::Empty if values is an empty IEnumerable(Of String).
| Exception | Condition |
|---|---|
| ArgumentNullException | values is null. |
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 element in values.
If values is an empty IEnumerable(Of String), the method returns String::Empty. If values is null, the method throws an ArgumentNullException exception.
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<TSource> method is passed to the Concat(IEnumerable<String^>^) method to display the result as a single string.
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 7.1
Windows Phone
Available since 8.1