You can use LastIndexOf in combination with Substring :
myString.Substring(0, myString.LastIndexOf('.'))
Although the Path class has a method that will do this in a strongly typed way, whether the passed path has a directory path or not:
Path.GetFileNameWithoutExtension("images.png")
Odded source share