Answers for "python remove part of string after character"

2

remove n from string python

a_string = a_string.rstrip("n")
Posted by: Guest on July-01-2020
1

remove part of string python

txt = 'abbacabbd'
print(url.replace('bbd',''))

#output:
abbaca
Posted by: Guest on July-16-2020
2

remove a part of a string python

url = 'abcdc.com'
print(url.replace('.com',''))
Posted by: Guest on July-20-2020
0

python extract all characters from string before a character

s1 = "Username: How are you today?"
>>> s1.split(':')
['Username', ' How are you today?']
>>> s1.split(':')[0]
'Username'
Posted by: Guest on November-23-2020

Code answers related to "python remove part of string after character"

Python Answers by Framework

Browse Popular Code Answers by Language