return containsOnly(str, validChars.toCharArray());
if (str.length() == 0) { return true; } if (valid.length == 0) { return false; } return indexOfAnyBut(str, valid) == -1;
    public static boolean containsOnly(String str, String validChars) {        if (str == null || validChars == null) {            return false;        }        return containsOnly(str, validChars.toCharArray());    }