java - How can i substring of path based on my requirement? -


string root = getservletcontext().getrealpath(""); 

means i'm getting root value c:\users\vinay\documents\netbeansprojects\fileanalog\build\web\

but need root value output till c:\users\vinay\documents\netbeansprojects\fileanalog\ how can write new string root1 root till fileanalog.thanks help.

string root2 = root.substring(0, root.indexof("build"));

its working fine


Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -