Answers for "delete part of string from string in python"

1

how to remove a string inside another string python

pythonCopylist_str = {'Abc.ex', 'Bcd.ex', 'cde.ex', 'def.jpg', 'efg.jpg'}
new_set = {x.replace('.ex', '').replace('.jpg', '') for x in list_str}
Posted by: Guest on September-13-2021
3

Python Remove a character from a string

# Python program to remove single occurrences of a character from a string
text= 'ItsMyCoode'
print(text.replace('o','',1))
Posted by: Guest on December-08-2021
0

remove a part of a string python

import re
url = 'abcdc.com'
url = re.sub('\.com$', '', url)
Posted by: Guest on July-20-2020

Code answers related to "delete part of string from string in python"

Python Answers by Framework

Browse Popular Code Answers by Language