源码

	public static String removeNonBmpUnicodes(String s) {
		return null == s ? null : s.replaceAll("[^\\u0000-\\uFFFF]", "");
	}

测试用例

    @Test
    public void testRemoveNonBmpUnicode() {
        String name = "皮????????????????皮????虾";
        System.out.println(removeNonBmpUnicode(name));
    }

测试结果

皮皮虾

相关文章:

  • 2022-12-23
  • 2021-12-07
  • 2022-02-27
  • 2022-02-17
  • 2021-07-11
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-07
  • 2021-09-26
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案