jodd-core/src/main/java/jodd/util/StringUtil.java
public static String replaceLast(final String s, final String sub, final String with) {
		int i = s.lastIndexOf(sub);
		if (i == -1) {
			return s;
		}
		return s.substring(0, i) + with + s.substring(i + sub.length());
	}
public static String replaceLast(final String s, final String sub, final String with) {
		int i = s.lastIndexOf(sub);
		if (i == -1) {
			return s;
		}
		return s.substring(0, i) + with + s.substring(i + sub.length());
	}
public static String replaceLast ( final String s , final String sub , final String with ) { int i = s . lastIndexOf ( sub ) ; if ( i == - 1 ) { return s ; } return s . substring ( 0 , i ) + with + s . substring ( i + sub . length ( ) ) ; }
Replaces the very last occurrence of a substring with supplied string.

@param s      source string
@param sub    substring to replace
@param with   substring to replace with
Replaces the very last occurrence of a substring with supplied string .