Skip to content

Instantly share code, notes, and snippets.

@Kaeleigh
Created October 12, 2017 15:39
Show Gist options
  • Save Kaeleigh/0962b343be4201675abd2d256cd78ab7 to your computer and use it in GitHub Desktop.
Save Kaeleigh/0962b343be4201675abd2d256cd78ab7 to your computer and use it in GitHub Desktop.
Ruby-Strings
# 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