C# String Concat(String, String, String, String)

Description

String Concat(String, String, String, String) concatenates four specified instances of String.

Syntax

String.Concat(String, String, String, String) has the following syntax.


public static string Concat(
  string str0,/* ww w  . java 2s .c o  m*/
  string str1,
  string str2,
  string str3
)

Parameters

String.Concat(String, String, String, String) has the following parameters.

  • str0 - The first string to concatenate.
  • str1 - The second string to concatenate.
  • str2 - The third string to concatenate.
  • str3 - The fourth string to concatenate.

Returns

String.Concat(String, String, String, String) method returns The concatenation of str0, str1, str2, and str3.

Example


/*from  www .  ja v a2  s .c om*/
using System;
using System.Collections;

public class Example
{
   public static void Main()
   {
      string[] words = { "A", "B", "C", "D" };
      string scrambledWord = String.Concat(words[0], words[1], 
                                              words[2], words[3]);
      Console.WriteLine(scrambledWord);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version