C# StringWriter Write(String, Object)
Description
StringWriter Write(String, Object)
Writes a formatted
string to the text string or stream, using the same semantics as the String.Format(String,
Object) method.
Syntax
StringWriter.Write(String, Object)
has the following syntax.
public virtual void Write(
string format,
Object arg0
)
Parameters
StringWriter.Write(String, Object)
has the following parameters.
format
- A composite format string (see Remarks).arg0
- The object to format and write.
Returns
StringWriter.Write(String, Object)
method returns
Example
using System;/*from w ww . j a va2s. co m*/
using System.Globalization;
using System.IO;
class StrWriter
{
static void Main()
{
StringWriter strWriter = new StringWriter();
strWriter.Write("{0} is from java2s.com",123D);
Console.WriteLine(strWriter.ToString());
}
}
The code above generates the following result.