📌  相关文章
📜  删除字符串 c# 代码示例的最后一个实例

📅  最后修改于: 2022-03-11 14:48:52.189000             🧑  作者: Mango

代码示例1
public static string ReplaceLastOccurrence(string Source, string Find, string Replace)
{
        int place = Source.LastIndexOf(Find);

        if(place == -1)
           return Source;

        string result = Source.Remove(place, Find.Length).Insert(place, Replace);
        return result;
}