string EV_HOME = System.Environment.GetEnvironmentVariable("EV_HOME");
string myFilePath = EV_HOME + "\\MyFolder\\MySubFolder";
Suppose EV_HOME return C:\myprogram\leanrning\anotherfolder
How can I remove the folder anotherfolder and get myFilePath as this
C:\myprogram\leanrning\MyFolder\MySubFolder
What I know is loop the Ev_HOME value and build each one (except the last one) as a new string.
thanks.
1 Answer