Como trabalhar com Texto em C#

27/05/2006

0

Gostaria de saber se em C tem alguma coisa tipo
[color=red:0c9db7507d]TStringList[/color:0c9db7507d] do Delphi pra trabalhar com texto ?


Fabiano Góes

Fabiano Góes

Responder

Posts

27/05/2006

Cvini

Voce pode usar a classe System.Text.StringBuilder.


Responder

28/05/2006

Fabiano Góes

Como criar e Ler arquivo texto com C

em Delphi eu faria
//Criar texto
var txt : TStringlist;
begin
  txt := TStringlist.Create;
  try
    txt.Add(´Meu Texto´);
    ...
    txt.SalveToFile(´c:\arquivo.txt´)
  finally
    FreeAndNil( txt )
  end;
end;


//Criar texto
var txt : TStringlist;
begin
  txt := TStringlist.Create;
  try
    txt.LoadToFile(´c:\arquivo.txt´)
    ...
  finally
    FreeAndNil( txt )
  end;
end;



como fazer isso em C ????


Responder

28/05/2006

Fabiano Góes

corrigindo o post acima ´|´

//Ler texto 
var txt : TStringlist; 
begin 
  txt := TStringlist.Create; 
  try 
    txt.LoadToFile(´c:\arquivo.txt´) 
    ... 
  finally 
    FreeAndNil( txt ) 
  end; 
end; 



Responder

11/06/2006

Fabiano Góes

[quote:98160ecd29=´Fabiano Góes´]Como criar e Ler arquivo texto com C

em Delphi eu faria
//Criar texto
var txt : TStringlist;
begin
  txt := TStringlist.Create;
  try
    txt.Add(´Meu Texto´);
    ...
    txt.SalveToFile(´c:\arquivo.txt´)
  finally
    FreeAndNil( txt )
  end;
end;


//Ler texto
var txt : TStringlist;
begin
  txt := TStringlist.Create;
  try
    txt.LoadToFile(´c:\arquivo.txt´)
    ...
  finally
    FreeAndNil( txt )
  end;
end;



como fazer isso em C ????[/quote:98160ecd29]

[color=red:98160ecd29][b:98160ecd29][size=18:98160ecd29]Como Fazer isso em C[/size:98160ecd29][/b:98160ecd29][/color:98160ecd29]


Responder

Assista grátis a nossa aula inaugural

Assitir aula

Saiba por que programar é uma questão de
sobrevivência e como aprender sem riscos

Assistir agora

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar