A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/dotnet/api/system.io.stringwriter.write below:

StringWriter.Write Method (System.IO) | Microsoft Learn

StringWriter.Write Method Definition

Writes data to the string.

Overloads Write(Char[], Int32, Int32)
Source:
StringWriter.cs
Source:
StringWriter.cs
Source:
StringWriter.cs
Source:
StringWriter.cs

Writes a subarray of characters to the string.

public:
 override void Write(cli::array <char> ^ buffer, int index, int count);
public override void Write(char[] buffer, int index, int count);
override this.Write : char[] * int * int -> unit
Public Overrides Sub Write (buffer As Char(), index As Integer, count As Integer)
Parameters
buffer
Char[]

The character array to write data from.

index
Int32

The position in the buffer at which to start reading data.

count
Int32

The maximum number of characters to write.

Exceptions

index or count is negative.

(index + count)> buffer. Length.

Examples

This code example is part of a larger example provided for the StringWriter() constructor.

// Use the three overloads of the Write method that are
// overridden by the StringWriter class.
strWriter.Write("file path characters are: ");
strWriter.Write(
    Path.InvalidPathChars, 0, Path.InvalidPathChars.Length);
strWriter.Write('.');
' Use the three overloads of the Write method that are 
' overridden by the StringWriter class.
strWriter.Write("file path characters are: ")
strWriter.Write( _
    Path.InvalidPathChars, 0, Path.InvalidPathChars.Length)
strWriter.Write("."C)
Remarks

This method overrides TextWriter.Write.

This method writes count characters of data to this StringWriter from buffer, starting at position index.

The following table lists examples of other typical or related I/O tasks.

See also Write(String)
Source:
StringWriter.cs
Source:
StringWriter.cs
Source:
StringWriter.cs
Source:
StringWriter.cs

Writes a string to the current string.

public:
 override void Write(System::String ^ value);
public override void Write(string value);
public override void Write(string? value);
override this.Write : string -> unit
Public Overrides Sub Write (value As String)
Parameters
value
String

The string to write.

Exceptions Examples

This code example is part of a larger example provided for the StringWriter class.

convertedCharacter = (char)intCharacter;
if(convertedCharacter == '.')
{
    strWriter.Write(".\n\n");

    // Bypass the spaces between sentences.
    strReader.Read();
    strReader.Read();
}
convertedCharacter = Convert.ToChar(intCharacter)
If convertedCharacter = "."C Then
    strWriter.Write("." & vbCrLf & vbCrLf)

    ' Bypass the spaces between sentences.
    strReader.Read()
    strReader.Read()
Remarks

This method overrides TextWriter.Write.

If the specified string is null, nothing is written.

The following table lists examples of other typical or related I/O tasks.

See also Write(StringBuilder)
Source:
StringWriter.cs
Source:
StringWriter.cs
Source:
StringWriter.cs
Source:
StringWriter.cs

Writes the string representation of a string builder to the current string.

public:
 override void Write(System::Text::StringBuilder ^ value);
public override void Write(System.Text.StringBuilder? value);
override this.Write : System.Text.StringBuilder -> unit
Public Overrides Sub Write (value As StringBuilder)
Parameters Write(Char)
Source:
StringWriter.cs
Source:
StringWriter.cs
Source:
StringWriter.cs
Source:
StringWriter.cs

Writes a character to the string.

public:
 override void Write(char value);
public override void Write(char value);
override this.Write : char -> unit
Public Overrides Sub Write (value As Char)
Parameters
value
Char

The character to write.

Exceptions Examples

This code example is part of a larger example provided for the StringWriter() constructor.

// Use the three overloads of the Write method that are
// overridden by the StringWriter class.
strWriter.Write("file path characters are: ");
strWriter.Write(
    Path.InvalidPathChars, 0, Path.InvalidPathChars.Length);
strWriter.Write('.');
' Use the three overloads of the Write method that are 
' overridden by the StringWriter class.
strWriter.Write("file path characters are: ")
strWriter.Write( _
    Path.InvalidPathChars, 0, Path.InvalidPathChars.Length)
strWriter.Write("."C)
Remarks

This method overrides TextWriter.Write.

The following table lists examples of other typical or related I/O tasks.

See also Write(ReadOnlySpan<Char>)
Source:
StringWriter.cs
Source:
StringWriter.cs
Source:
StringWriter.cs
Source:
StringWriter.cs

Writes the string representation of a span of chars to the current string.

public:
 override void Write(ReadOnlySpan<char> buffer);
public override void Write(ReadOnlySpan<char> buffer);
override this.Write : ReadOnlySpan<char> -> unit
Public Overrides Sub Write (buffer As ReadOnlySpan(Of Char))
Parameters

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4