Sign in to follow this  
Followers 0
scsnake

How to replace line breaks?

4 posts in this topic

I use "ControGetText" to exatact text in a Notepad file, and I want to let it "flattened", that is, delete all the line breaks.

Replacement of @LF, @CR, @CRLF seems to be failed :D

Any one can give me some hints? thx~~

eg.

Text in notepad:

This is the brok

en sentence, which

needs to be joined

together.

Result:

$string="This is the broken sentence, which needs to be joined together."

Share this post


Link to post
Share on other sites



Make sure you haven't checked automatic line break (or what it's called in english windows).

This will work if there really are linebreaks:

$string=StringReplace(StringReplace($string,@CR,""),@LF,"")

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

lots of ways,

someone surely has a regexp that would do the job....

You can perform stringreplace operations on all undesired chars, replacing them with an empty string.


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

i got some stupid mistakes @@

monoceres's code works fine ~~~ thx

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0