Created
March 31, 2012 20:38
-
-
Save sial-ari/2268288 to your computer and use it in GitHub Desktop.
function that removes plus sign from given text
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
import re | |
def filter_remove_plus(text): | |
pattern = re.compile('^\+') | |
lines = text.split('\n') | |
new_text = "" | |
for line in lines: | |
filtered_text = pattern.sub("", line) | |
new_text = new_text + filtered_text + "\n" | |
return new_text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment