Last active
August 29, 2015 13:56
-
-
Save Fergmux/8946068 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 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
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
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