@Immutable
    public static String rtrim(String s, String charsetList) {
        int i = s.length() - 1;
        while (i > 0 && charsetList.indexOf(s.charAt(i)) > -1) {
            i--;
        }
        return i <= 0 ? "" : s.substring(0, i + 1);
    }
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