擅长:python、mysql、java
<pre><code>str="https://ideas.repec.org/s/fip/fedgfe.html"
last_forward_slash_index=str.rfind('/') #rfind() will find the last forward slash '/'
str1=str[0:last_forward_slash_index]
print(str1) # It will print "https://ideas.repec.org/s/fip"
</code></pre>