首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

以全角/半角区划字符串

2012-10-27 
以全角/半角划分字符串?private ArrayListString getParseWord(String words) {if (words null || wo

以全角/半角划分字符串

?

private ArrayList<String> getParseWord(String words) {if (words == null || words.trim().length() == 0)return null;String[] word = Pattern.compile(Stringutils.HALFANDFULLHORNSYMBOLS).split(words);List<String> wordList = Arrays.asList(word);ArrayList<String> wordArr = new ArrayList<String>();if (wordList.size() > 0) {for (int index = 0; index < wordList.size(); index++) {String str = wordList.get(index);if (str != null && str.length() != 0) {wordArr.add(str);}}}return wordArr;}
?

?

?

热点排行