Concatenate more than two strings in CSharp

Description

The following code shows how to concatenate more than two strings.

Example


 /*from  www. j a va2 s . c om*/
using System; 
 
public class ConcatDemo1 { 
  public static void Main() { 
 
    string result = String.Concat("This ", "is ", "a ", 
                                  "test ", "of ", "the ", 
                                  "String ", "class."); 
 
    Console.WriteLine("result: " + result); 
 
  } 
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Data Types »




C# Data Types
Bool
Byte
Char
Decimal
Double
Float
Integer
Long
Short
String
C# Array
Array Example
Byte Array
C# Standard Data Type Format
BigInteger
Complex
Currency
DateTime
DateTimeOffset
DateTime Format Parse Convert
TimeSpan
TimeZone
Enum
Null
tuple
var