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(
String.LastIndexOf would work.
string fileName= "abc.123.txt"; int fileExtPos = fileName.LastIndexOf("."); if (fileExtPos >= 0 ) fileName= fileName.Substring(0, fileExtPos);