public static String cleanString(String in) {
        StringBuffer out = new StringBuffer();
        char c;
        for (int i = 0; i < in.length(); i++) {
            c = in.charAt(i);
            if (c == ' ' || c == '-') out.append('_');
            else if (Character.isLetterOrDigit(c) || c == '_') {
                out.append(c);
            }
        }
        return out.toString().toLowerCase();
    }