How do I replace commas in a string [closed]
楼主#更多 发布于：2016-05-30 21:31
I want to remove all commas from a string using regular expressions, I want letters, periods and numbers to remain just commas
Why a regex? mystring = mystring.replace(",", "")
is enough. Of course, if you insist: mystring = re.sub(",", "", mystring)
but that's probably an order of magnitude slower.