title: How to tidy up this with Ruby
body: <p>I have a String array which I want to convert to specifc format. For example</p>
  
  <pre><code>y = ["hello","how","you"]
  </code></pre>
  
  <p>And the output should be the following exact String </p>
  
  <pre><code>[["hello","hello"],["how","how"],["you","you"]]
  </code></pre>
  
  <p>I have currently used the following way which is working fine for me, but I need to know is there a better way to do this in Ruby</p>
  
  <pre><code>"[#{y.collect {|x| "[#{["\"#{x}\"", "\"#{x}\""].join(",")}]" }.join(",").to_s}]"
  </code></pre>