Java, Removing backslash in string object

前端 未结 4 775
梦谈多话
梦谈多话 2020-12-10 21:20

I have a URL like this: http:\\/\\/www.example.com\\/example in a string object.

Can somebody tell me, how to remove the backslashes? <

4条回答
  •  自闭症患者
    2020-12-10 21:51

    See String.replace(CharSequence, CharSequence)

    String myUrl = "http:\\/\\/www.example.com\\/example";
    myUrl = myUrl.replace("\\","");
    

提交回复
热议问题