首页 > 学院 > 开发设计 > 正文

提取英文中的单词

2019-11-18 11:25:06
字体:
来源:转载
供稿:网友

用正则表达式很简单
String s="this is a test,   powerful split";
String[] arr=s.split("[^a-zA-Z]+"); //6个单词的数组
for(int i=0;i<arr.length;i++)
      System.out.PRintln(arr[i]);



发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表