title: Ruby String read from file outputting backslashes
body: <p>I want to read data.txt file and output the same as string2, but when I read from the file Ruby prints the backslashes, why is that so and how can I avoid it?</p>
  
  <p>data.txt contains</p>
  
  <blockquote>
    <p>\",\"foo\":{\"id\":1111,\"name\":\"Bar\",</p>
  </blockquote>
  
  <pre><code>file = File.open("data.txt", "r")
  string1 = file.read
  
  puts "string1: #{string1}"
  
  string2 = "\",\"foo\":{\"id\":1111,\"name\":\"Bar\","
  puts "string2: #{string2}"
  </code></pre>
  
  <p>Output</p>
  
  <pre><code>$ ruby test.rb
  \",\"role\":{\"id\":1111,\"name\":\"Mobile\",
  ","role":{"id":1111,"name":"Mobile",
  </code></pre>
  
  <p>My goal is to read data.txt and output ","role":{"id":1111,"name":"Mobile",</p>