C# StringWriter WriteLine(String, Object, Object, Object)
Description
StringWriter WriteLine(String, Object, Object, Object)
Writes
out a formatted string and a new line, using the same semantics as Format.
Syntax
StringWriter.WriteLine(String, Object, Object, Object)
has the following syntax.
public virtual void WriteLine(
string format,//from ww w .j av a2s.c om
Object arg0,
Object arg1,
Object arg2
)
Parameters
StringWriter.WriteLine(String, Object, Object, Object)
has the following parameters.
format
- A composite format string (see Remarks).arg0
- The first object to format and write.arg1
- The second object to format and write.arg2
- The third object to format and write.
Returns
StringWriter.WriteLine(String, Object, Object, Object)
method returns
Example
using System;/* w w w . j a v a 2 s.com*/
using System.Globalization;
using System.IO;
class StrWriter
{
static void Main()
{
StringWriter strWriter = new StringWriter();
strWriter.WriteLine("{0} and {1} and {2}",123,123,345);
Console.WriteLine(strWriter.ToString());
}
}
The code above generates the following result.