Sign in to follow this  
Followers 0
madasraka

How to remove new line ?

3 posts in this topic

I figured how to add new line using @crlf

but how to remove it using stringreplace ?

stringreplace ($string,@crlf,'') ? or what?

If so i want to make sure i remove that for the correct line.

Any ideas ?

I think i can count what line would neet to be removed, but how to remove it i have no clue

PLease help.

Thanks in advance

Share this post


Link to post
Share on other sites



StringReplace($string, @CRLF, "")

StringReplace($string, @CR, "")

StringReplace($string, @LF, "")

StringStripCR($string)

It depends on what you need replaced.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

If you want to replace double @CRLF with single @CRLF, use:

$string = "xxx"&@CRLF&"yyy"&@CRLF&@CRLF&"zzz"
MsgBox(0,"Before",$string)
$string = StringReplace($string,@CRLF&@CRLF,@CRLF)
MsgBox(0,"After",$string)

For more than 2 @CRLF, use StringRegExpReplace(a bit advanced):

$string = "xxx"&@CRLF&"yyy"&@CRLF&@CRLF&@CRLF&"zzz"
MsgBox(0,"Before",$string)
$string = StringRegExpReplace($string,"(\r\n)(\1)+","\1")
MsgBox(0,"After",$string)

Hi ;)

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