StringWriter.ToString Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Devolve uma string contendo os caracteres escritos na corrente StringWriter até ao momento.
public:
override System::String ^ ToString();
public override string ToString();
override this.ToString : unit -> string
Public Overrides Function ToString () As String
Devoluções
A cadeia que contém os caracteres escritos na corrente StringWriter.
Exemplos
Este exemplo de código faz parte de um exemplo maior fornecido ao StringWriter(IFormatProvider) construtor.
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())
Observações
A tabela seguinte lista exemplos de outras tarefas típicas ou relacionadas de E/S.
| Para fazer isso... | Veja o exemplo neste tópico... |
|---|---|
| Crie um arquivo de texto. | Como: Gravar texto em um arquivo |
| Escreve num ficheiro de texto. | Como: Gravar texto em um arquivo |
| Lido de um ficheiro de texto. | Como: Ler texto de um arquivo |