Hello,
Check below code it will used replace file name with new file name
string ReplaceText = @"G:\Trial\WorkDirectory\Kabhi Kabhi Aditi\abc.npr";
ReplaceText = ReplaceText.Replace(ReplaceText.Substring(ReplaceText.LastIndexOf(@"\") + 1, ReplaceText.Length - (ReplaceText.LastIndexOf(@"\") + 1)), "xyz.xml");
Thanks
Gaurav Dhol