From 8b5d6b83f6b555672f0f98ec44e54b88ba71b8c7 Mon Sep 17 00:00:00 2001 From: Ievgen Pyrogov <207112+gmile@users.noreply.github.com> Date: Sun, 16 Jul 2023 22:50:53 +0200 Subject: [PATCH] Update io.ex Fix newlines in documentation for IO module --- lib/elixir/lib/io.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/elixir/lib/io.ex b/lib/elixir/lib/io.ex index ba4271ffc44..55cc98c9ce4 100644 --- a/lib/elixir/lib/io.ex +++ b/lib/elixir/lib/io.ex @@ -594,11 +594,11 @@ defmodule IO do Another example where you might want to collect a user input every new line and break on an empty line, followed by removing - redundant new line characters (`"\n"`): + redundant new line characters (`"\\n"`): IO.stream(:stdio, :line) - |> Enum.take_while(&(&1 != "\n")) - |> Enum.map(&String.replace(&1, "\n", "")) + |> Enum.take_while(&(&1 != "\\n")) + |> Enum.map(&String.replace(&1, "\\n", "")) """ @spec stream(device, :line | pos_integer) :: Enumerable.t()