String::Concat<T> Method (IEnumerable<T>)
Concatenates the members of an IEnumerable<T> implementation.
Assembly: mscorlib (in mscorlib.dll)
[ComVisibleAttribute(false)] public: generic<typename T> static String^ Concat( IEnumerable<T>^ values )
The type of the members of values.
Return ValueType: System::String
The concatenated members in values.
The method concatenates each object in values; it does not add any delimiters.
An Empty string is used in place of any null argument.
is a convenience method that lets you concatenate each element in an IEnumerable<T> collection without first converting the elements to strings. It is particularly useful with Language-Integrated Query (LINQ) query expressions, as the example illustrates. The string representation of each object in the IEnumerable<T> collection is derived by calling that object's ToString method.
The following example defines a very simple Animal class that contains the name of an animal and the order to which it belongs. It then defines a List<T> object to contain a number of Animal objects. The Enumerable::Where extension method is called to extract the Animal objects whose Order property equals "Rodent". The result is passed to the method and displayed to the console.
.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)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.