C# String ToString()
Description
String ToString()
returns this instance of String; no
actual conversion is performed.
Syntax
String.ToString()
has the following syntax.
public override string ToString()
Returns
String.ToString()
method returns The current string.
Example
The following example demonstrates the ToString method.
using System;// ww w. ja va 2 s . com
class stringToString {
public static void Main() {
String str1 = "123";
String str2 = "abc";
str2 = str1.ToString();
Console.WriteLine(str2);
}
}
The code above generates the following result.