C# String Concat(Object, Object, Object)
Description
String Concat(Object, Object, Object)
concatenates
the string representations of three specified objects.
Syntax
String.Concat(Object, Object, Object)
has the following syntax.
public static string Concat(
Object arg0,/*from w w w .j av a 2 s. c om*/
Object arg1,
Object arg2
)
Parameters
String.Concat(Object, Object, Object)
has the following parameters.
arg0
- The first object to concatenate.arg1
- The second object to concatenate.arg2
- The third object to concatenate.
Returns
String.Concat(Object, Object, Object)
method returns The concatenated string representations of the values of arg0, arg1, and
arg2.
Example
The following example demonstrates the Concat method.
//from ww w .jav a 2s. co m
using System;
class stringConcat5 {
public static void Main() {
int i = -123;
Object o = i;
Object[] objs = new Object[] {-123, -456, -789};
Console.WriteLine(String.Concat(o));
Console.WriteLine(String.Concat(o, o));
Console.WriteLine(String.Concat(o, o, o));
Console.WriteLine(String.Concat(o, o, o, o));
Console.WriteLine(String.Concat(o, o, o, o, o));
Console.WriteLine(String.Concat(objs));
}
}
The code above generates the following result.