Writes data to the string.
Overloads Write(Char[], Int32, Int32)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
The character array to write data from.
The position in the buffer at which to start reading data.
The maximum number of characters to write.
Exceptionsindex
or count
is negative.
(index
+ count
)> buffer
. Length
.
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)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
The string to write.
Exceptions ExamplesThis 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)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)
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
The character to write.
Exceptions ExamplesThis 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>)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 articleWas 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