Facebook
From Sweltering Eider, 5 Years ago, written in Python.
Embed
Download Paste or View Raw
Hits: 232
  1. import re
  2.  
  3. def abbreviate(words):
  4.     words = re.split(r'(?:[^a-zA-Z\'])', words)
  5.     acro = ""
  6.     for item in words:
  7.         acro += item[:1]
  8.     return acro.upper()
  9.     return w.group()