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
Post a Comment