I have a problem where I need to replace the last occurrence of a word in a string.
Situation: I am given a string which is in this format:
var lastIndex = filePath.LastIndexOf(TnaName); filePath = filePath.Substring(0, lastIndex);