scsnake Posted April 19, 2008 Share Posted April 19, 2008 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 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." Link to comment Share on other sites More sharing options...
monoceres Posted April 19, 2008 Share Posted April 19, 2008 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! Link to comment Share on other sites More sharing options...
flyingboz Posted April 19, 2008 Share Posted April 19, 2008 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. Link to comment Share on other sites More sharing options...
scsnake Posted April 19, 2008 Author Share Posted April 19, 2008 i got some stupid mistakes @@ monoceres's code works fine ~~~ thx Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now