# switch 文. 型で判別OK

# Ruby

o

variable1 = 'test'
case variable1
when String then
  message = 'variable1 is String!'
when Numeric then
  message = 'variable1 is Numeric!'
else
  message = 'variable1 is Object or something!'
end

[ 📩 ご意見 ]