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

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -