/**
* @function
* @param source 待分句的句子
* @param div 分隔符
* @param include 结果中是否包含分隔符
* @return
*/
public static String[] split(String source, String div, boolean include) {
StringTokenizer tokens = new StringTokenizer(source, div, include);
String[] result = new String[tokens.countTokens()];
int i = 0;
while (tokens.hasMoreTokens()) {
result[i++] = tokens.nextToken();
}
return result;
}
切分句子(非正则)
最新推荐文章于 2023-10-08 23:34:54 发布