读写代码实现把字符串"case when 条件 1 in (‘城区厅,乡镇厅’)" 中的中文打印出来
public static void main(String[] args) {
String str = "case when 条件 1 in (‘城区厅,乡镇厅’)";
String reg = "[\\u4e00-\\u9fa5]";
Pattern pattern = Pattern.compile(reg);
Matcher matcher = pattern.matcher(str);
while(matcher.find()){
System.out.print(matcher.group());
}
}
String str = "case when 条件 1 in (‘城区厅,乡镇厅’)";
String reg = "[\\u4e00-\\u9fa5]";
Pattern pattern = Pattern.compile(reg);
Matcher matcher = pattern.matcher(str);
while(matcher.find()){
System.out.print(matcher.group());
}
}
温馨提示:答案为网友推荐,仅供参考
第1个回答 2015-08-04
你这是sql 啊,用java实现的话,jdbc,hibernate都可以弄,感觉你就是简单的获取中文字符串,就用jdbc吧。。。