title: How to make Scanner Properly Read Escape Characters?
body: <p>I'm reading from a file that reads something like all on one line:</p>
  
  <pre><code>Hello World!\nI've been trying to get this to work for a while now.\nFrustrating.\n
  </code></pre>
  
  <p>And my Scanner reads that from the file and puts it in a String:</p>
  
  <pre><code>Scanner input = new Scanner(new File(fileName));
  String str = input.nextLine();
  System.out.print(str);
  </code></pre>
  
  <p>Now, I want the output then to be:</p>
  
  <pre><code>Hello World!
  I've been trying to get this work for a while now.
  Frustrating.
  </code></pre>
  
  <p>But instead I'm getting the exact same thing as the input. That is, each \n is included in the output and everything is on one line instead of separate lines.</p>
  
  <p>I thought that Scanner would be able to read the escape character properly but it's instead copying it onto the String like it's \\n.</p>