title: Is it possible to set a parameter inside an otherwise constant String?
body: <p>I am using a set of constant Strings for text anonymization. One of the strings should go something like "[Town in the state of XX]", where XX is to be replaced later with an actual state (the rest of the string remains as is).</p>
  
  <p>My question is: is there a way to do this "elegantly" (in the spirit of a SQL <a href="http://docs.oracle.com/javase/7/docs/api/java/sql/PreparedStatement.html" rel="nofollow">PreparedStatement</a>)?
  Or should I just put XX and then do myString.replace("XX", "someState"), in which case, the string can no longer be a constant :(</p>
  
  <p>EDIT: Just realized that String.replace returns a new String, so myString could still be a constant with this method.</p>