3 Replies Latest reply: Feb 10, 2009 10:48 PM by 843785 RSS

    Escape variables in strings

    843785
      In ruby I can say:

      myVar = "more text"
      "this is some text and my variable is #{myVar}. here is more text at the end"

      How can I do this in java without saying
      String myVar= "more text", text;
      text = "this is some text and my variable is " + myVar + ". here is more text at the end";