南猫猫猫猫猫

导航

2022年9月23日 #

正则,java匹配

摘要: 1.判断字符串中是否全为英文 boolean result = str.matches("[a-zA-Z]+"); //true:全文英文 `str.matches("[a-zA-Z0-9]+") //判断英文和数字````` 2.提取字符串中所有的英文 str = str.replaceAll(" 阅读全文

posted @ 2022-09-23 09:48 南猫猫猫猫猫 阅读(31) 评论(0) 推荐(0) 编辑