StringWriter.ToString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a string containing the characters written to the current StringWriter
so far.
public:
override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
Returns
The string containing the characters written to the current StringWriter
.
Examples
This code example is part of a larger example provided for the StringWriter(IFormatProvider) constructor.
Console::WriteLine( "Current date and time using the invariant culture: {0}\n"
"Current date and time using the Algerian culture: {1}", DateTime::Now.ToString(), strWriter->ToString() );
Console.WriteLine(
"Current date and time using the invariant culture: {0}\n" +
"Current date and time using the Algerian culture: {1}",
DateTime.Now.ToString(), strWriter.ToString());
Console.WriteLine( _
"Current date and time using the invariant culture: {0}" _
& vbCrLf & _
"Current date and time using the Algerian culture: {1}", _
DateTime.Now.ToString(), strWriter.ToString())
Remarks
The following table lists examples of other typical or related I/O tasks.
To do this... | See the example in this topic... |
---|---|
Create a text file. | How to: Write Text to a File |
Write to a text file. | How to: Write Text to a File |
Read from a text file. | How to: Read Text from a File |
Applies to
See also
Werk met ons samen op GitHub
De bron voor deze inhoud vindt u op GitHub, waar u ook problemen en pull-aanvragen kunt maken en bekijken. Raadpleeg onze gids voor inzenders voor meer informatie.