Strings Exercise

In case you get stuck anywhere, don't be afraid to ask the coaches! They are here to help and will gladly explain everything to you!

Take notes during the exercises. Even if you never look at them again, they will help you memorise things!

For these exercises, we're only going to use IRB.

Remember: To run IRB, open a command line window (Powershell or Terminal). Then enter the command irb and press Enter.

To exit a running IRB, enter the command exit.

  1. What is a String? Try to explain it to yourself or another participant in your own words.

  2. How do you recognize a String when it appears in Ruby code?

  3. How long is the following String? "I really think I am getting the hang of Ruby now."

  4. Turn around the following String: "I like these exercises."

  5. Does the following String include the letter “m”? "Come on, let’s all learn Ruby!"

  6. The whole String in capital letters, please! "I am learning Ruby."

  7. The whole String in small letters, please! "Let’s code RUBY!"

  8. Capitalize the following String, please! "ruby monstas for the win!"