Created
October 28, 2015 13:44
-
-
Save jaeming/efa5c5933438ed90cc68 to your computer and use it in GitHub Desktop.
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
class Abbreviator | |
def self.abbreviate(s) | |
s.split(/\b/).map{|w|w.size>3?"#{w[0]}#{w.size-2}#{w[-1]}":w}.join | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment