+ 1
What does the get.chomp do exactly
it doesn't explain very well i have no idea what it means
2 Antworten
+ 2
Gets user input without last char like tab or linefeed
0
"gets" stands for "get string". The user must type some text, then hit Enter when done.
The Enter keypress is included in the user string as a newline (\n) character.
e.g. "hello\n"
"chomp" removes that final \n char.
Lookup "Ruby chomp" to learn how to remove other chars from the end of a string.