Jump to content
Sign in to follow this  
_Kurt

StringReplace($string, @CRLF, "")

Recommended Posts

_Kurt

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
Jos

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                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
_Kurt

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
theguy0000

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
_Kurt

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
_Kurt

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
Jos

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                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
_Kurt

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
Jos

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                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
_Kurt

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
theguy0000

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
SmOke_N

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


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.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.