LoginSignup
2

More than 5 years have passed since last update.

rubyにおける標準入出力

Posted at

puts

putsは文字列表現や改行などを文字列表現に変換して出力してくれます。一般的にwebサイトで表示したいときはこのputsを使います。

print

printは改行のない状態で出力される。

p

型表現も含めた形で出力する。主にデバックで用いられる。

gets

ターミナルから入力したいときに使う。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2