Sign in to follow this  
Followers 0
_Kurt

StringReplace($string, @CRLF, "")

12 posts in this topic

Title says it all. I'm wondering if there is a way to replace an @CRLF with nothing or a space.

Thanks,

Kurt


Awaiting Diablo III..

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Title says it all. I'm wondering if there is a way to replace an @CRLF with nothing or a space.

Thanks,

Kurt

Sure,. just do as the title states ... should work fine :P Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Maybe I'm doing something wrong. Let me look over a couple of stuff. I've been racking my brain over this for twenty minutes.

I'll be soon to respond,

Kurt


Awaiting Diablo III..

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

if it's not working for you, might want to try all CRs the LFs individually.

just incase they dont use Windows-style line-breaks

Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Well it seems to work fine for an "ordinary" string:

Example:

$string   = "line 1" & @CRLF & "line 2"
$newstr = StringReplace($string, @CRLF, "")
oÝ÷ ÛMúì,

$newstr = $string ;<-- that's not right

Not sure why this isn't working.

Thanks,

Kurt

Edited by _Kurt

Awaiting Diablo III..

Share this post


Link to post
Share on other sites

if it's not working for you, might want to try all CRs the LFs individually.

just incase they dont use Windows-style line-breaks

$newstr = StringReplace($Text, @CR & @LF, "")

This still does not work for me.

Kurt


Awaiting Diablo III..

Share this post


Link to post
Share on other sites

Well it seems to work fine for an "ordinary" string:

Example:

$string   = "line 1" & @CRLF & "line 2"
$newstr = StringReplace($string, @CRLF, "")
oÝ÷ ÛMúì,

$newstr = $string ;<-- that's not right

Not sure why this isn't working.

Thanks,

Kurt

Just save the string to a file and look at it with an HexEditor to check the exact content ..

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Okay, thanks for a solution! :P

Is there a different way this could be done? Since that may require more time to write/read the file

Thanks again,

Kurt


Awaiting Diablo III..

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Okay, thanks for a solution! :P

Is there a different way this could be done? Since that may require more time to write/read the file

Thanks again,

Kurt

This is just for debugging ... not permanent !!! Its to check what characters are realy there ...

You could try , as suggested, to replace the CR's and LF's separately:

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

$newstr = StringReplace($newstr , @LF, "")

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

THANK YOU JdeB! That worked perfectly :P Sorry for misunderstanding the seperate @CR and @LF's before.

Thanks again,

Kurt


Awaiting Diablo III..

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

This is just for debugging ... not permanent !!! Its to check what characters are realy there ...

You could try , as suggested, to replace the CR's and LF's separately:

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

$newstr = StringReplace($newstr , @LF, "")

yeah, that's what I meant :P Edited by theguy0000

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

$newstr = StringReplace(StringStripCR($string), @LF, '')
Doesn't work?


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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