How To Remove Certain Characters From A Variable? (python)
Let's suppose I have a variable called data. This data variable has all this data and I need to remove certain parts of it while keeping most of it. Let's say I needed to remove al
Solution 1:
Just replace them:
data = data.replace(',', '')
If you have more characters, try using .translate()
:
data = data.translate(None, ',.l?asd')
Post a Comment for "How To Remove Certain Characters From A Variable? (python)"