Created
October 12, 2017 15:39
-
-
Save Kaeleigh/0962b343be4201675abd2d256cd78ab7 to your computer and use it in GitHub Desktop.
Ruby-Strings
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
# My Solutions | |
def to_batman_comic(text) | |
p "#{text}!".upcase | |
end | |
to_batman_comic('bam') | |
to_batman_comic('zoink') | |
def first_longer_than_second(first, second) | |
p "#{first}".length >= "#{second}".length | |
p "#{first}".length >= "#{second}".length | |
end | |
first_longer_than_second('pneumonoultramicroscopicsilicovolcanoconiosis', 'k') #=> false | |
first_longer_than_second('apple', 'prune') #=> true | |
# Bloc Solutions | |
def to_batman_comic(text) | |
"#{text.upcase}!" | |
end | |
def first_longer_than_second(first, second) | |
first.length >= second.length | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment