开发者

MySQL String Last Index Of

开发者 https://www.devze.com 2023-02-28 17:40 出处:网络
I开发者_如何转开发 am able to use LOCATE to get the index of a character such as a . in www.google.com. Thus I can use substring to strip out everything before the first ..

I开发者_如何转开发 am able to use LOCATE to get the index of a character such as a . in www.google.com. Thus I can use substring to strip out everything before the first ..

Is there a way I can look for the last /?

So I can get test.htm out of http://www.example.com/dev/archive/examples/test.htm?

I do not want to say the 6th slash, I want to say the last slash. Can this be done?


Use substring_index

select substring_index('http://www.example.com/dev/archive/examples/test.htm','/',-1)
0

精彩评论

暂无评论...
验证码 换一张
取 消