Jump to content
UBot Underground

Recommended Posts

Hello,

 

Is the newline character represented by \n, or\r\n?

 

Both of these examples remove the trailing returns, but is one more 'robust' than the other?

 

set(#string_old, "Line One
Line Two
Line Three{$new line}{$new line}{$new line}", "Global")
set(#string_new, $replace regular expression(#string_old, "\\n+$", $nothing), "Global")
set(#string_old, "Line One
Line Two
Line Three{$new line}{$new line}{$new line}", "Global")
set(#string_new, $replace regular expression(#string_old, "[\\r\\n]+$", $nothing), "Global")

 

Regards,

Sean

Link to post
Share on other sites

If you're scraping from the web (HTML) then \n is enough...

If you're manipulating files from different OS as sources... you may need them both, but it's not a problem if you want to use them both all the time anyway.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...