How to remove all special characters from all strings in a list of strings with Python

1 Answer

0 votes
lst = ["\npython\t", "\t\tjava", "\rPHP\r", "\r\nc#\n", "\npascal", "vb.net\n\t\r"] 
 
lst = list(map(str.strip, lst)) 
 
print(lst) 
 
 
 
'''
run:
 
['python', 'java', 'PHP', 'c#', 'pascal', 'vb.net']
 
'''

 



answered Jan 13, 2020 by avibootz

Related questions

...