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

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

javascript - jquery or ashx not working -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -