android - Java regex with reserved chars -
this question has answer here:
i'm using pattern string this
url = "http://mywebsite.com:1700/[lang]/service/?customerid=[customerid]";
i'm using code replace parameters.
url.replace("[lang]", languagename);
also tryied :
url.replace("\\[lang\\]", languagename);
but not worked.
java strings immutable. replace()
returns new string , need capture it:
url = url.replace("[lang]", languagename);
Comments
Post a Comment