mirror of
https://github.com/rust-lang/book.git
synced 2026-09-14 23:42:18 -04:00
@@ -770,8 +770,9 @@ user must press the <span class="keystroke">enter</span> key to satisfy
|
||||
`read_line`. When the user presses <span class="keystroke">enter</span>, a
|
||||
newline character is added to the string. For example, if the user types <span
|
||||
class="keystroke">5</span> and presses <span class="keystroke"> enter</span>,
|
||||
`guess` looks like this: `5\n`. The `\n` represents “newline,” the enter key.
|
||||
The `trim` method eliminates `\n`, resulting in just `5`.
|
||||
`guess` looks like this: `5\n`. The `\n` represents “newline,” the
|
||||
<span class="keystroke">enter</span>key. The `trim` method eliminates `\n`,
|
||||
resulting in just `5`.
|
||||
|
||||
The [`parse` method on strings][parse]<!-- ignore --> parses a string into some
|
||||
kind of number. Because this method can parse a variety of number types, we
|
||||
|
||||
Reference in New Issue
Block a user