C# StringWriter WriteLine()

Description

StringWriter WriteLine() Writes a line terminator to the text string or stream.

Syntax

StringWriter.WriteLine() has the following syntax.


public virtual void WriteLine()

Returns

StringWriter.WriteLine() method returns

Example


/* w  ww  . ja  v  a  2  s.  c o m*/
using System;
using System.Globalization;
using System.IO;

class StrWriter
{
    static void Main()
    {
        StringWriter strWriter = new StringWriter();
        
        strWriter.WriteLine();
        strWriter.WriteLine("from java2s.com");
        
        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