如何取出字符串中的汉字

2025-03-12 15:50:03
推荐回答(1个)
回答1:

String str = "java怎么把字符串中的的汉字取出来";
String reg = "[^\u4e00-\u9fa5]";str = str.replaceAll(reg, "");