Special character garbled solutions, directly use the ASCII code comparison table to solve

int symbol =  42;
System.out.println(symbol+":"+(char)symbol);

附:ASCII编码对照表网站:http://ascii.911cha.com/?year=12

/**
 * Randomly generate a time length verification code
 * @param times
 * @return
 */
private static String randomGenerateVertifivationCode(int times) {
    String ret = "";
    for (int i = 0; i < times; i++) {
        int intVal = (int) (Math.random() * 26 + 97);
        ret + = (char) intVal;
    }
    return ret;
}

Guess you like

Origin blog.csdn.net/qq_36336332/article/details/100852647