We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 694b9b0 commit 1dbf121Copy full SHA for 1dbf121
lib/elixir/lib/io.ex
@@ -593,11 +593,11 @@ defmodule IO do
593
594
Another example where you might want to collect a user input
595
every new line and break on an empty line, followed by removing
596
- redundant new line characters (`"\n"`):
+ redundant new line characters (`"\\n"`):
597
598
IO.stream(:stdio, :line)
599
- |> Enum.take_while(&(&1 != "\n"))
600
- |> Enum.map(&String.replace(&1, "\n", ""))
+ |> Enum.take_while(&(&1 != "\\n"))
+ |> Enum.map(&String.replace(&1, "\\n", ""))
601
602
"""
603
@spec stream(device, :line | pos_integer) :: Enumerable.t()
0 commit comments