-3

I'm using a pattern string like this

url = "http://myWebsite.com:1700/[LANG]/service/?customerid=[CUSTOMERID]";

I'm using this code to replace parameters.

url.replace("[LANG]", languageName);

also tryied :

url.replace("\\[LANG\\]", languageName);

but not worked.

Ahmad Behzadi
  • 1,006
  • 15
  • 30

1 Answers1

2

Java Strings are immutable. replace() returns a new string and you need to capture it:

url = url.replace("[LANG]", languageName);
laalto
  • 150,114
  • 66
  • 286
  • 303