Skip to content

Instantly share code, notes, and snippets.

@jxpx777
Created November 14, 2014 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jxpx777/93ac31d651fa76587757 to your computer and use it in GitHub Desktop.
Save jxpx777/93ac31d651fa76587757 to your computer and use it in GitHub Desktop.
class String
def to_numeronym
self.gsub(/\A(.)(.*)(.)\Z/) { "#{$1}#{$2.length}#{$3}" }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment