Requirement: Get all characters before or after a specified character of a character
Example:
URL = https://www.baid/v2/user/login
(1) Want to get v2 data: v2/user/login
print url[url.rfind('/v2'):]
(2) Want to get the data before /v2: https://www.baid/
print url[0:url.rfind('/v2')]
Author: Syw
The copyright of this article belongs to the author, and you are welcome to reprint it, but this statement must be retained without the author's consent, and a link to the original text is given in an obvious position on the article page, otherwise the right to pursue legal responsibility is reserved.
If there are any mistakes in the text, please point them out.lest more people be misled.