Answers for "remove certain characters from string python"

10

remove word from string python

#You can remove a word from a string using str.replace ()
myString = 'papa is a good man'
newString = myString.replace('papa', '')
>>>' is a good man'
Posted by: Guest on March-14-2020
15

take off character in python string

s = 'abc12321cba'

print(s.replace('a', ''))
Posted by: Guest on August-10-2020
7

remove special characters from string python

>>> string = "Special $#! characters   spaces 888323"
>>> ''.join(e for e in string if e.isalnum())
'Specialcharactersspaces888323'
Posted by: Guest on May-20-2020
8

delete certain characters from a string python

for char in line:
    if char in " ?.!/;:":
        line.replace(char,'')
Posted by: Guest on April-08-2020
4

remove specific word from string using python

#you can use replace function to remove specific word.
>>> message = 'you can use replace function'
>>> message.replace('function', '')
>>>'you can use replace '
Posted by: Guest on June-03-2020
1

python remove multiple characters from string

import re
print(re.sub("e|l", "", "Hello people"))
"Ho pop"
Posted by: Guest on December-01-2020

Code answers related to "remove certain characters from string python"

Python Answers by Framework

Browse Popular Code Answers by Language