Home > Back-end >  Memo to remove a newline character
Memo to remove a newline character

Time:10-02



StringReplace (memo1. Lines. Text, #, 10 # 13 ', '[rfReplaceAll]);
Memo2. Text:=memo1. Text;


Why can't write it

CodePudding user response:

StringReplace (memo1. Lines. Text, # # 10, 13 ', '[rfReplaceAll]);

CodePudding user response:

reference 1st floor sz_haitao response:
StringReplace (memo1. Lines. Text, # # 10, 13 ', '[rfReplaceAll]);



+ 1

Pay attention to order

CodePudding user response:

Can not replace, the high efficiency method and the
Memo1. Lines. Text:=memo1 Lines. DelimitedText;

CodePudding user response:

reference pathletboy reply: 3/f
can not replace, the high efficiency method and the
Memo1. Lines. Text:=memo1 Lines. DelimitedText;

For high efficiency,

CodePudding user response:

If D is more than 2007 version:
Memo1. Lines. StrictDelimiter:=True;//strict first separator, or encounter Spaces will be more quotes'
Memo2. Text:=memo1. Lines. DelimitedText;//and then take the delimiter text

If it is D7 version, or a replacement:
StringReplace (memo1. Lines. Text, # # 10, 13 ', '[rfReplaceAll]);//# 13 is tail carriage return, # 10 was a head wrap, tail first come
Because there is no memo1 D7 version. Lines. StrictDelimiter function, space will be out of the trouble,

CodePudding user response:

Enter is # 13 # 10 first, secondly StringReplace (memo1. Lines. Text, # # 10, 13 ', '[rfReplaceAll]) will not change the value of memo1
To answer the assignment statements memo2. Text:=StringReplace (memo1. Lines. Text, # # 10, 13 ', '[rfReplaceAll]),
And a high efficient statements upstairs

CodePudding user response:

Take StringReplace function return values, memo1 value will not because out StringReplace is changed

CodePudding user response:

reference pathletboy reply: 3/f
can not replace, the high efficiency method and the
Memo1. Lines. Text:=memo1 Lines. DelimitedText;


The top

CodePudding user response:

refer to the eighth floor Stiven_PFan response:
Quote: refer to the third floor pathletboy response:

Can not replace, the high efficiency method and the
Memo1. Lines. Text:=memo1 Lines. DelimitedText;


Top

+ 1

CodePudding user response:

references 9 f i_am_a_fish response:
Quote: refer to the eighth floor Stiven_PFan response:

Quote: refer to the third floor pathletboy response:

Can not replace, the high efficiency method and the
Memo1. Lines. Text:=memo1 Lines. DelimitedText;


Top

+ 1


references 9 f i_am_a_fish response:
Quote: refer to the eighth floor Stiven_PFan response:

Quote: refer to the third floor pathletboy response:

Can not replace, the high efficiency method and the
Memo1. Lines. Text:=memo1 Lines. DelimitedText;


Top

+ 1




+ 10086

CodePudding user response:

 
Memo1. Lines. Text,=StringReplace (memo1. Lines. Text, # # 10, 13 ', '[rfReplaceAll]);
Memo2. Text:=memo1. Text;

CodePudding user response:

Right on the ground floor, remember is carriage returns # 13 # 10, rather than enter a new line
  • Related