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:
You have to do the replace manually:
int i = filePath.LastIndexOf(TnaName); if (i >= 0) filePath = filePath.Substring(0, i) + filePath.Substring(i + TnaName.Length);