I'm writing server side in python.
I noticed that the client sent me one of the parameter like this:
"↵ tryit1.tar↵ "
I want to get rid of spaces (and for that I use the replace
command), but I also want to get rid of the special character: "↵".
How can I get rid of this character (and other weird characters, which are not -
,_
,*
,.
) using python command?
A regex would be good here:
re.sub('[^a-zA-Z0-9-_*.]', '', my_string)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With