Reputation: 447
I know this value should be used Substring but i am not sure how to do this in C#. Your given code much appreciated. thanks!
What i want to change this :
"C:\\TFS\\Deployment\\files\\1.0.1.1\\test\\test00.xml"
to new value:
"C:\\TFS\\Deployment\\files\\1.0.1.1"
Upvotes: 0
Views: 1261
Reputation: 11770
Well, it's hard to determine what criteria is used to truncate the string. Besides D.R.'s answer:
"C:\\TFS\\Deployment\\files\\1.0.1.1\\test\\test00.xml".Substring(0,31);
Upvotes: 1
Reputation: 21224
var testPath = System.IO.Directory.GetParent(path);
var newValue = System.IO.Directory.GetParent(testPath);
Upvotes: 11