Answers for "get last string separated by /"

0

get last string separated by /

String str = "www.anywebsite.com/folder/subfolder/directory";
int index = str.lastIndexOf('/');
String lastString = str.substring(index +1);
Posted by: Guest on May-05-2021

Code answers related to "get last string separated by /"

Browse Popular Code Answers by Language