java - how to trim the characters in an path extracted from XML? -



java - how to trim the characters in an path extracted from XML? -

//abc:def/m1/m/123/test

im extracting path xml file . want trim characters "/test"(remove these characters path). have tried lastindexof(".") , trim(). unable trim characters .

if want _remove /text, can try

string path="//abc:def/m1/m/123/test"; path = path.substring(0,path.lastindexof("/")); system.out.println(path);

output:

//abc:def/m1/m/123

java xml

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -