Use the ToString() method to convert StringBuilder to a string
using System;
using System.Text;
class MainClass
{
public static void Main()
{
StringBuilder myStringBuilder = new StringBuilder();
myStringBuilder.Append("friends");
string myString2 = myStringBuilder.ToString();
Console.WriteLine("myString2 = " + myString2);
}
}
Output myString2 = friends
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|