If I have a string saying \"abc.txt\", is there a quick way to get a substring that is just \"abc\"?
\"abc.txt\"
\"abc\"
I can\'t do an fileName.IndexOf(
fileName.IndexOf(
There's a method in the framework for this purpose, which will keep the full path except for the extension.
System.IO.Path.ChangeExtension(path, null);
If only file name is needed, use
System.IO.Path.GetFileNameWithoutExtension(path);