Javatpoint Logo
Javatpoint Logo

Ruby Case Statement

In Ruby, we use 'case' instead of 'switch' and 'when' instead of 'case'. The case statement matches one statement with multiple conditions just like a switch statement in other languages.




Ruby switch 1

Look at the above output, conditions are case sensitive. Hence, the output for 'Saturday' and 'saturday' are different.

Next TopicRuby for loop

Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA