public static String format(String str, String formatName)
    {
        final Formatter formatter = DEFAULT_FORMATTERS.get(formatName);
        if (formatter != null)
            return formatter.format(str);

        // regex replace
        int eq = formatName.indexOf("==");
        if (eq > 0)
        {
            String toReplace = formatName.substring(0, eq);
            String replacement = formatName.substring(eq + 2);

            if (toReplace.length() == 1 && replacement.length() == 1)
                return str.replace(toReplace.charAt(0), replacement.charAt(0));

            return str.replaceAll(toReplace, replacement);
        }

        return str + formatName;
    }
Formats the string {@code str} using the format {@code formatName}.
<p>
If the formatter with the name does not exist, the input string will be appended with the formatName.
protostuff-compiler/src/main/java/io/protostuff/compiler/STCodeGenerator.java