Skip to content

Instantly share code, notes, and snippets.

@Fergmux
Last active August 29, 2015 13:56
Show Gist options
  • Save Fergmux/8946068 to your computer and use it in GitHub Desktop.
Save Fergmux/8946068 to your computer and use it in GitHub Desktop.
def anti_vowel(text):
for x in text:
c = x.lower()
n = list(text)
if c in 'aeiou':
i = text.index(c)
n[i] = ''
text = ''.join(n)
return text
@danmux
Copy link

danmux commented Feb 11, 2014

Case sensitive....



def anti_vowel2(text):
    out = ''
    for c in text:
        if not c.lower() in 'aeiou':
            out = out + c

    return out   


@danmux
Copy link

danmux commented Feb 11, 2014


import re
def anti_vowel(text):
    return re.sub(r'[aeoui]', '', text, flags=re.I)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment