Categories
How to remove a substring from a string by slice?
There is a string x = 'asdasd asd asd asd asd as asd' How to remove a substring from a string by typeslice[1:4]
x = 'asdasd asd asd asd asd as asd'
slice[1:4]
Answer the question
In order to leave comments, you need to log in
x = x[:1] + x[4:] # or x = '{}{}'.format(x[:1], x[4:])
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question