Tuesday, August 26, 2008

Replacing path seperator string with anothercharacter.

Replacing path seperator string with anothercharacter.
Code snippet:-
string Path =@ "-\\XXX\\YYY\\ZZZ\\File.txt";
string NewPath = Path.Replace("\\file:///");
Now the NewPath will be "//XXX/YYY/ZZZ/File.txt"

No comments: