Strings in Ruby

55 exercises

About Strings

The key thing to remember about Ruby strings is that they are objects that you call methods on. You can find all the methods in the Ruby docs

It's also worth knowing that strings can be created using single quotes (') or double quotes ("). Single-quoted strings don't process ASCII escape codes(\n, \t etc.), and they don't do string interpolation while double-quoted does both.

You can also create strings using the heredoc syntax or using the %q and %Q helpers.

Edit via GitHub The link opens in a new window or tab

Learn Strings

Practicing is locked

Unlock 21 more exercises to practice Strings