I am trying to get a string after the third slash. But I do not know how to do this. I used split, but that is not what I want.
for(String obj2: listKey.getCommonPrefixes()){ Map<String, String> map = new HashMap<String, String>(); String[] id = obj2.split("/"); if (id.length > 3) { String name = id[3]; map.put("id", name); map.put("date", "null"); map.put("size", String.valueOf(obj2.length())); keys.add(map); } }
id[3] gives me only id[3] , but I want everything after the third slash? How can i do this?
java substring indexof
Shaonline
source share