I have a multiple string urls, from which i have to pick last few characters, which are id's infact. But the problem is that, the length of id's is not consistent, i.e., if one id is of length 6 then, other may be of length 5 or 4 and so on. The sample urls are like:
www.abc.com/xyz-123456
www.abc.com/pqr-5432
www.abc.com/lmn/opqr-25647
it could have been a lot easier if the length of the particular id portion would have been same, i could have used:
String abc = "www.abc.com/xyz-123456";
String id = abc.substring(abc.length()-6);
But now the scenario is different as length of id portion in the selected url is not the same always, How can i cater this varying id..???? please any help is appreciated.