SyntaxFix
Write A Post
Hire A Developer
Questions
String.LastIndexOf would work.
string fileName= "abc.123.txt"; int fileExtPos = fileName.LastIndexOf("."); if (fileExtPos >= 0 ) fileName= fileName.Substring(0, fileExtPos);