Search code examples
crystal-lang

Read whole lines from $stdin without pressing enter with crystal-lang


It's a similar question that Read a single char from stdin without pressing enter

How do I read whole lines with crystal-lang ? I assume to use following Ruby equivalent code:

lines = $stdin.read
lines.each{|line| puts line}

Solution

  • Apparently the equivalent of read is STDIN.gets_to_end FWIW.

    https://groups.google.com/forum/#!topic/crystal-lang/O4DExFHJc5E