C# StringWriter WriteLine(String, Object[]) Array

Description

StringWriter WriteLine(String, Object[]) Writes out a formatted string and a new line, using the same semantics as Format.

Syntax

StringWriter.WriteLine(String, Object[]) has the following syntax.


public virtual void WriteLine(
  string format,
  params Object[] arg
)

Parameters

StringWriter.WriteLine(String, Object[]) has the following parameters.

  • format - A composite format string (see Remarks).
  • arg - An object array that contains zero or more objects to format and write.

Returns

StringWriter.WriteLine(String, Object[]) method returns

Example


using System;// w  ww . j a  v a 2s . co m
using System.Globalization;
using System.IO;

class StrWriter
{
    static void Main()
    {
        StringWriter strWriter = new StringWriter();
        
        strWriter.WriteLine("{0} is from java2s.com",new object[]{32L});
        
        Console.WriteLine(strWriter.ToString());
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter