0

Can we use two line of code in a single line in Ruby?

In languages like java if we write code after ; it is considered as a new line. Can we write two line of codes in a single line with space? Or is there any other way out for the same? Where exactly does Ruby take the end of line for a code?

25th Jun 2020, 4:16 PM
Shubhangi Shruti
Shubhangi Shruti - avatar
2 ответов
+ 1
Why didn't you try? I tried: puts "1"; puts "2" and it worked.
25th Jun 2020, 4:35 PM
Seb TheS
Seb TheS - avatar