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(
You can use
string extension = System.IO.Path.GetExtension(filename);
And then remove the extension manually:
string result = filename.Substring(0, filename.Length - extension.Length);