java正则表达式判断字符串是否仅含有数字和字母

阅读 54

2022-04-19

java正则表达式判断字符串是否仅含有数字和字母

直接上代码

public static boolean isLetterDigit(String str) {
  String regex = "^[a-z0-9A-Z]+$";
  return str.matches(regex);
 }

相关推荐

精彩评论(0)

0 0 举报