Answers for "python get last level by parsing character"

11

how to select last 2 elements in a string python

>>>mystr = "abcdefghijkl"
>>>mystr[-4:]
'ijkl'

>>>mystr[:-4] #to select all but last 4 characters
'abcdefgh'
Posted by: Guest on July-09-2020
1

python everything after last slash

url.rsplit('/', 1)[-1]
Posted by: Guest on May-28-2020

Code answers related to "python get last level by parsing character"

Python Answers by Framework

Browse Popular Code Answers by Language