I learned about Ruby in class, so make a note. This time, I mainly investigated the difference between the'p',' puts', and'print' methods used when outputting numbers and character strings, so I will describe how.
Method | new line | Display argument type information |
---|---|---|
p | o | o |
puts | o | x |
x | x |
Also, with the p method, when you output with the argument "Hellow World", the quotation marks at both ends are also output.
I(puts)]https://qiita.com/Chinats/items/c464c3a88c263f15224b
Recommended Posts