StringWriter.ToString Metoda

Definicja

Zwraca ciąg zawierający znaki zapisane do bieżącej StringWriter do tej pory.

public:
 override System::String ^ ToString();
public override string ToString ();
override this.ToString : unit -> string
Public Overrides Function ToString () As String

Zwraca

Ciąg zawierający znaki zapisane w bieżącym StringWriterobiekcie .

Przykłady

Ten przykład kodu jest częścią większego przykładu podanego dla konstruktora StringWriter(IFormatProvider) .

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())

Uwagi

W poniższej tabeli wymieniono przykłady innych typowych lub powiązanych zadań we/wy.

Aby wykonać tę czynność... Zobacz przykład w tym temacie...
Twórca pliku tekstowego. Instrukcje: Zapisywanie tekstu w pliku
Zapisywanie w pliku tekstowym. Instrukcje: Zapisywanie tekstu w pliku
Odczyt z pliku tekstowego. Instrukcje: Odczytywanie tekstu z pliku

Dotyczy

Zobacz też