Recent

Author Topic: [SOLVED] change "comma" and "double-quotes" to "empty-space" for Lines.CommaText  (Read 3562 times)

Elmug

  • Hero Member
  • *****
  • Posts: 849
Hi everyone,

I am to get a string from a Memo1, using Lines.CommaText, but the string has comma-separator, and also don't want the double quotes.

I am having trouble changing those to space, and would appreciate help.

I try  SetQuoteChar := ' '; but get "identifier not found "SetQuoteChar".

Thanks!
 

« Last Edit: July 08, 2012, 03:49:13 am by Elmug »

Avishai

  • Hero Member
  • *****
  • Posts: 1021
This may get you started.

Procedure Tform1.Speedbutton5click(Sender: Tobject);
var
  AList: TStringList;
Begin
  AList:= TStringList.Create;
    AList.CommaText:= ListBox1.Items.CommaText;
    AList.Delimiter:= ' ';
    Label1.Caption:= AList.DelimitedText;
  FreeAndNil(AList);
End;
Lazarus Trunk / fpc 2.6.2 / Win32

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Try StringReplace for " with a space
Lazarus Trunk / fpc 2.6.2 / Win32

Elmug

  • Hero Member
  • *****
  • Posts: 849
Try StringReplace for " with a space
Hi, Avishai,

I deleted the previous post where I thought the comma had been replaced by a space, using your suggestion.

I will try some more and get back, with results, or need for additional help.

Thanks!

Elmug

  • Hero Member
  • *****
  • Posts: 849
I found out I could simply use:

aString : String;
aString := TEdit(Memo1).Text;


Thanks everyone!