Last active
August 29, 2015 14:07
-
-
Save paulghaddad/a39a1eac55fd8173959d to your computer and use it in GitHub Desktop.
Level Up 2: Knows how to find documentation for Ruby and Rails classes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ruby core has so many more methods than you'll ever keep in your head. That's totally fine, but you need to know how to look up and use those functions. Use the ruby docs to find the docs for the String class. There's a method that lets you substitute a bunch of characters for a corresponding set of characters (it's not gsub). Find that method and use it in a code sample. | |
"My name is Paul Haddad, and I am from Columbus!".sub(/Columbus/, 'Chicago') | |
=> "My name is Paul Haddad, and I am from Chicago!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment