C# StringWriter Write(Char[]) Array

Description

StringWriter Write(Char[]) Writes a character array to the text string or stream.

Syntax

StringWriter.Write(Char[]) has the following syntax.


public virtual void Write(
  char[] buffer
)

Parameters

StringWriter.Write(Char[]) has the following parameters.

  • buffer - The character array to write to the text stream.

Returns

StringWriter.Write(Char[]) method returns

Example


using System;/*from  w w w  .  j ava 2 s  .  c  o  m*/
using System.Globalization;
using System.IO;

class StrWriter
{
    static void Main()
    {
        StringWriter strWriter = new StringWriter();

        strWriter.Write(new char[]{'.','a','v','c'});
        
        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