Oct-03-2020, 09:14 PM
Another silly function I use often...
(I got an extention module with functions not in python lib.)
Stripping a bunch of caracters from a string.
(I got an extention module with functions not in python lib.)
Stripping a bunch of caracters from a string.

def strStripAll(s,ss): return ''.join([c for c in s if c not in ss]) s = 'q werty 1234567890' ss1 = strStripAll(s,' ') ss2 = s.replace(' ','') ss3 = strStripAll(s,'') ss4 = strStripAll(s,'97 w') ss5 = s.replace('97 w','') ss6 = s.replace('9','').replace('7','').replace(' ','').replace('w','') #lol