Java将\替换成/

    public static void main(String[] args) {
        String str="upload\\media\\201904\\i4Qjz8E40xGQovUq-2CMi-HrBaUrGFZhv9konAyx0Yg.jpg";
        String result=str.replaceAll("\\\\", "/");
        System.out.println(result);
    }

猜你喜欢

转载自www.cnblogs.com/jiefu/p/10797525.html