1 (edited by prahousefamily 2017-04-28 08:54:01)

Topic: How To Convert string in multi lines to one line

In form1.memo1.text have string and 5 rows

A
B
C
D
E

how to change  5 row to 1 row and new order string in same row in form1.memo2.text

A,B,C,D,E

Help Me Please! How To Edit Script ?

My Visual Database : I Love You
Easy For Beginner Student For Me

Re: How To Convert string in multi lines to one line

Hello prahousefamily,


The lines contained in a memo are TStrings and this has a property CommaText

Try something like this :

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
var
    memo_content : Tstrings;
begin
    memo_content := Form1.Memo1.Lines;

    Form1.Edit1.Text := memo_content.commatext;
end;

Hope this helped


Have a good weekend


Math

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: How To Convert string in multi lines to one line

OK It Work !
Thank You Very Much Math.

little Question ?
Can change  From "," (Comma) to "|" or "symbole" or "text" ?

My Visual Database : I Love You
Easy For Beginner Student For Me

Re: How To Convert string in multi lines to one line

Maybe something like

Form1.Edit1.Text := ReplaceStr(memo_content.commatext,',','|');

Math

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

5 (edited by prahousefamily 2017-04-30 01:22:26)

Re: How To Convert string in multi lines to one line

Hi mathmathou Help me please Fix Speed Code
How to edit code fix speed process when click it more slow
same process  loop ?
Or  Change Even TableGrid Fix Slow?
Help me please !
https://s17.postimg.org/w0n8kex4v/2017-04-30_08_10_36.png

Post's attachments

Attachment icon CheckBoxInGrid.zip 336.77 kb, 407 downloads since 2017-04-30 

My Visual Database : I Love You
Easy For Beginner Student For Me