@Immutable
    public static String strtr(@Nullable String string, @Nullable String from, @Nullable String to) {
        if (string == null || string.isEmpty()) {
            return "";
        }

        if ((from == null || from.isEmpty()) || (to == null || to.isEmpty())) {
            return string;
        }

        char[] chars = string.toCharArray();
        boolean replaced = false;

        // If from and to have different lengths, the extra characters in the longer of the two are ignored.
        for (int i = 0, idx = 0, length = Math.min(from.length(), to.length()); i < length; i++) {
            while ((idx = string.indexOf(from.charAt(i), idx)) > -1) {
                replaced = true;
                chars[idx++] = to.charAt(i);
            }
        }

        return replaced ? String.valueOf(chars) : string;
    }
Parses the cslashes bitmap returning an actual bitmap.

@param charset the bitmap string

@return the actual bitmap
exts/jphp-zend-ext/src/main/java/org/develnext/jphp/zend/ext/standard/StringFunctions.java