@Nonnull
	public static String replaceLast(@Nonnull String string, @Nonnull String toReplace, @Nonnull String replacement) {
		int i = string.lastIndexOf(toReplace);
		if (i > -1)
			return string.substring(0, i) + replacement + string.substring(i + toReplace.length());
		return string;
	}
Replace the last match of some text in the given string.

@param string
		Text containing items to replace.
@param toReplace
		Pattern to match.
@param replacement
		Text to replace pattern with.

@return Modified string.
recaf-core/src/main/java/software/coley/recaf/util/StringUtil.java