C# String Concat(Object)
Description
String Concat(Object)
creates the string representation
of a specified object.
Syntax
String.Concat(Object)
has the following syntax.
public static string Concat(
Object arg0
)
Parameters
String.Concat(Object)
has the following parameters.
arg0
- The object to represent, or null.
Returns
String.Concat(Object)
method returns The string representation of the value of arg0, or String.Empty if arg0 is
null.
Example
The following example demonstrates the Concat method.
/* www . ja v a 2 s . c o 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.