title: New line character as part of the String
body: <p>I've got the problem creating String looking as follows: </p>
  
  <pre><code>"SSR LANG SA  HK1/EN;S7;P1\n"+
  </code></pre>
  
  <p>Code that does that should append \n as part of the string + quote + append string literal + actual new line literal:</p>
  
  <pre><code>javaFormattedText.append("   \""+ tokenizer.nextElement() + "\\n\"+\n");
  </code></pre>
  
  <p>The output String should look:</p>
  
  <pre><code>"SSR LANG SA  HK1/EN;S7;P1\n"+
  </code></pre>
  
  <p>But it looks:</p>
  
  <pre><code>"SSR LANG SA  HK1/EN;S7;P1
  \n"+
  </code></pre>
  
  <p>Therefore java complains about unclosed string literal.</p>
  
  <p>The purpose of doing it is generating test classes dynamically and those contain a lot of text information that needs to be java formatted strings.</p>
  
  <p>How can achieve the target? </p>
  
  <p><strong>UPD</strong></p>
  
  <p>Solved the problem by doing this:</p>
  
  <pre><code>String line = (String) AIR_textTokenizer.nextElement();
  
  line = line.replace("\n", "").replace("\r", "");
  </code></pre>