Search code examples
javastringblackberry

Java, Removing backslash in string object


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

Can somebody tell me, how to remove the backslashes?

I am programming for an blackberry system.


Solution

  • See String.replace(CharSequence, CharSequence)

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