newline
Last updated
Was this helpful?
Last updated
Was this helpful?
The newline
keyword literal represents the : \n
. It's useful for navigating or assembling strings.
Besides its natural uses in building strings, newline
has a special purpose within these string filters:
â When used with newline
, this filter will replace instances of "\r\n"
, and then instances of "\n"
.
â When used with newline
as its first argument, this filter will replace instances of "\r\n"
, and then instances of "\n"
.
â When used with newline
, this filter will split by "\r\n"
when present, and then by "\n"
.
Under the hood, each of these scenarios uses the regular expression /\r?\n/
.