madasraka Posted October 13, 2010 Share Posted October 13, 2010 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 Link to comment Share on other sites More sharing options...
enaiman Posted October 13, 2010 Share Posted October 13, 2010 StringReplace($string, @CRLF, "") StringReplace($string, @CR, "") StringReplace($string, @LF, "") StringStripCR($string) It depends on what you need replaced. PoojaKrishna 1 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 :) Link to comment Share on other sites More sharing options...
Mison Posted October 13, 2010 Share Posted October 13, 2010 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 ;) 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