1.在选择字符串范围内随机生成字符串 String zfcAll = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; char[] zfc = zfcAll.toCharArray(); String str = RandomStringUtils.random(32,zfc);