Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python strip multiple characters

>>> import re
>>> name = "Barack (of Washington)"
>>> re.sub('[(){}<>']', '', name)
>>> print(name)
Barack of Washington
Comment

python remove multiple characters from string

import re
print(re.sub("e|l", "", "Hello people"))
"Ho pop"
Comment

PREVIOUS NEXT
Code Example
Python :: df count zeros 
Python :: pandas test for nan 
Python :: except python 
Python :: create an empty dataframe 
Python :: death stranding 
Python :: set size of button tkinter 
Python :: keras tuner 
Python :: padnas drop column 
Python :: save a torch tensor 
Python :: python frame in a frame 
Python :: normal distribution in python 
Python :: tkinter messagebox 
Python :: tf dropout 
Python :: Python cheat sheet pdf download 
Python :: sorted vs sort python 
Python :: python pandas replace not working 
Python :: timestamp e datetime python 
Python :: python test is nan 
Python :: delete spaces in string python 
Python :: imblearn randomoversampler 
Python :: python: measure time code 
Python :: failed to allocate bitmap 
Python :: pandas create new column conditional on other columns 
Python :: python get latest edited file from any directory 
Python :: python program to solve quadratic equation 
Python :: how to make label background transparent in tkinter 
Python :: Handling Python DateTime timezone 
Python :: calculate angle between 3 points python 
Python :: pandas plot move legend 
Python :: Set a random seed 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =