Created
May 8, 2017 04:50
-
-
Save EmanuelCadems/2c0e5aef21d4dd55bb4ceb77d092b964 to your computer and use it in GitHub Desktop.
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
def string_rev_4(word) | |
if word.length < 4 | |
word.reverse | |
else | |
word | |
end | |
end | |
puts string_rev_4('hello') | |
puts string_rev_4('yo') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment