Last active
August 29, 2015 14:14
-
-
Save mozamimy/1ccb6269705b34e7966a to your computer and use it in GitHub Desktop.
2014-03-05.rb
This file contains hidden or 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
| str = "Alice" # => "Alice" |
This file contains hidden or 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
| name = "Alice" | |
| str = "I am #{name}!\n" # => I am Alice!\n |
This file contains hidden or 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
| str = 'Alice' |
This file contains hidden or 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
| name = "Alice" | |
| str = 'I am #{name}!\n' # => I'm #{name}!\\n |
This file contains hidden or 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
| alice = %!Alice! # => "Alice" | |
| cheshire_cat = %Q[Cheshire Cat] # => "Cheshire Cat" | |
| white_rabbit = %q[White Rabbit] # => "White Rabbit" |
This file contains hidden or 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
| queen_of_hearts = %Q*Queen of Hearts* # => "Queen of Hearts" |
This file contains hidden or 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
| "Alice found a bottle".gsub(/^(.+) found/, '\1 picked up') | |
| # => "Alice picked up a bottle" |
This file contains hidden or 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
| "Alice found a bottle".gsub(/^(.+) found/, "\\1 picked up") | |
| # => "Alice picked up a bottle" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment