test = "hello\nhi" pp test pp test.includes? "n"
As we can see, the line feed
\n is printed on line 3, we can confirm that because
pp's output is:
"hello\n" + "hi" (see the
however, in the docs, it says:
trueif the string contains search .
I asked gitter about this last week or so, but my head still explodes when I see this code.
Do the combination of letters
n get converted into a line feed when read, making the
n disappear? Thus returning false? But, at the same time, the letters
n are inside a string
edit: I think my first hypothesis is correct, because if you look here https://play.crystal-lang.org/#/r/64mq, it returns true. Because
\z isn’t a carriage, line feed, etc?