C# String Concat(String, String)
Description
String Concat(String, String)
concatenates two specified
instances of String.
Syntax
String.Concat(String, String)
has the following syntax.
public static string Concat(
string str0,
string str1
)
Parameters
String.Concat(String, String)
has the following parameters.
str0
- The first string to concatenate.str1
- The second string to concatenate.
Returns
String.Concat(String, String)
method returns The concatenation of str0 and str1.
Example
The following example concatenates a person's first, middle, and last name.
/*from ww w. j a v a 2 s .co m*/
using System;
public class ConcatTest {
public static void Main() {
string fName = "A";
string mName = "B";
string lName = "C";
Console.WriteLine(string.Concat( string.Concat(fName, mName), lName ) );
}
}
The code above generates the following result.