This commit is contained in:
2020-09-03 17:35:06 +00:00
parent 5825b490fa
commit 3deaa13ce8
4 changed files with 165 additions and 15 deletions

View File

@@ -118,6 +118,18 @@ namespace AyaNova.Util
return str;
}
public static string ReplaceLastOccurrence(string source, string find, string replace)
{
if (source == null) { return source; }
int place = source.LastIndexOf(find);
if (place == -1)
return source;
string result = source.Remove(place, find.Length).Insert(place, replace);
return result;
}
}//eoc