2 Replies Latest reply: Feb 7, 2014 6:33 PM by huangxinghui RSS

    Multiple replace in string



      I have a string like



      And I want to replace variables with appropriate values. Now I do this with next code:

      myString.replace("%seriesName%", seriesName).replace("%pipeKey%", pipeKey).replace("%kmFrom%", kmFrom).replace("%kmTo%", kmTo).replace("%modeKey%", modeKey);


      Maybe there is shorter and prettier algorithm exists?


      Thank you!