繁体   English   中英

字符串replaceAll连字符不起作用Java 8

[英]String replaceAll hyphen not working java 8

String test = "Vol. 5 −";
        test = test.replaceAll("\u2014", "");
        test = test.replaceAll("//-", "");
        test = test.replaceAll("-","");
        System.out.println(test);

在所有可能的输出中仍获得“ Vol。5-”

    String test = "Vol. 5 −";
    test = test.replaceAll("\u2212", "");
    System.out.println(test);

工作正常

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM