title: How to remove line break when reading files in Ruby
body: <p>I'm trying to get rid of the brackets <code>[]</code> and the new line <code>\n</code> from being printed.</p>
  
  <p>My code looks like:</p>
  
  <pre><code>name1 = File.readlines('first.txt').sample(1)
  name2 = File.readlines('middle.txt').sample(1)
  name3 = File.readlines('last.txt').sample(1)
  
  name = print (name1.strip 
      print name2.strip 
      print name3.strip)
  
  puts name
  </code></pre>
  
  <p>I would like the output to look like <code>JoshBobbyGreen</code>.
  However, it looks like:</p>
  
  <pre><code>[\"Josh\\n\"][\"Bobby\\n\"][\"Green\\n\"]
  </code></pre>
  
  <p>I've tried using <code>.gsub</code>, <code>chomp</code> and <code>split</code> but maybe I'm using them wrong.</p>