This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user