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 :: python subtract 2 strings 
Python :: standardscaler in machine learning 
Python :: python endswith list 
Python :: plot pandas figsize 
Python :: powershell to python converter 
Python :: how to slice odd index value from a list in python using slice function 
Python :: get list of users django 
Python :: python install tabulate 
Python :: python system of nonlinear equations 
Python :: opencv get contours 
Python :: django gunicorn static file not found 
Python :: fetch python 
Python :: flask marshmallow 
Python :: scipy rfft 
Python :: pandas drop columns by index 
Python :: convert bytes to numpy array python 
Python :: remove trailing and leading spaces in python 
Python :: pygame left click 
Python :: cv2.GaussianBlur() 
Python :: how to sort values in numpy by one column 
Python :: python no new line 
Python :: python how to remove the title of the index from dataframe 
Python :: python get square root 
Python :: python matplotlib hist set axis range 
Python :: Difference between end and sep python 
Python :: convert string representation of a list to list 
Python :: download image python 
Python :: get cpu count in python 
Python :: python temporary files 
Python :: plotly reverse y axis 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =