Jump to content

StringReplace($string, @CRLF, "")


_Kurt
 Share

Recommended Posts

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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

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

Link to comment
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

Edited by _Kurt

Awaiting Diablo III..

Link to comment
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..

Link to comment
Share on other sites

  • Developers

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 ..

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...