C# StringWriter WriteLine(Char[], Int32, Int32)

Description

StringWriter WriteLine(Char[], Int32, Int32) Writes a subarray of characters followed by a line terminator to the text string or stream.

Syntax

StringWriter.WriteLine(Char[], Int32, Int32) has the following syntax.


public virtual void WriteLine(
  char[] buffer,//from w  w w  .  ja  v  a2  s.  com
  int index,
  int count
)

Parameters

StringWriter.WriteLine(Char[], Int32, Int32) has the following parameters.

  • buffer - The character array from which data is read.
  • index - The character position in buffer at which to start reading data.
  • count - The maximum number of characters to write.

Returns

StringWriter.WriteLine(Char[], Int32, Int32) method returns

Example


using System;//from   w w  w . j a  v  a  2 s  .c om
using System.Globalization;
using System.IO;

class StrWriter
{
    static void Main()
    {
        StringWriter strWriter = new StringWriter();
        
        strWriter.WriteLine(new char[]{'a','v','c','d'},0,2);
        
        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