Does anyone knows how to remove/replace from string "/" and "\" in C#?
I have string which looks like this:
string myString= @"d:\Folder1\folder name2\file.ext";
I need either get rid of "\" or just get file name without all this garbage of its location.
The Path class
Whenever you need to do something modifying a path, the Path class is a go-to solution. It’s platform-specific, and at least on windows, it supports both
/and\(viaPath.DirectorySeparatorCharandPath.AltDirectorySeparatorChar).