How to replace only the LAST occurrence of a substring.
Posted on August 18, 2011
1 2 3 4 5 | 'String Manipulation - How to replace only the LAST occurrence of a substring. Function ReplaceLast(Source As String, Search As String, ReplaceStr As String) As String ReplaceLast = StrReverse(Replace(StrReverse(Source), StrReverse(Search), _ StrReverse(ReplaceStr), , 1)) End Function |