现在的位置: 首页 > 综合 > 正文

java 去掉字符串中的’/'字符

2013年08月28日 ⁄ 综合 ⁄ 共 249字 ⁄ 字号 评论关闭

最近发现比较简单的去掉'/'字符居然不能直接用'/'去替。

public class TestString {
    public TestString() {
    }

    public String replace(String a) {
        return a.replaceAll("//u005c", "");
    }

    public static void main(String[] args) {
        TestString t = new TestString();
        System.out.println(t.replace("abcdefg//fajdkl"));
    }
} 

 

 

抱歉!评论已关闭.