簡體   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