I have strings in form of an URL. The strings looks like
http://www.somezwebsite.com/en/someString/xx-38944672
I am interested on the last part of the URL, the /xx-38944672
. I need to extract the xx
between the last /
and the -
which could be one or more characters. I also need to extract the number, 38944672
in this example. The number could also have a different length.
I think I could achieve this by determining the index of the last / the index of the last - and the index of the last character in the string, then proceed the sub-strings. Is there a cleaner way to do this?