Print elements of ruby array line by line after splitting a single string with "\n" condition
<p>I have a single string, achieved using backticks of the following form:</p>

<pre><code>output = `git log`
</code></pre>

<p>then, I have splitted the result where there are "\n" and the result went into an array of the form:</p>

<pre><code>array = output.split("\n")
</code></pre>

<p>then, I am just trying to output the result in the screen, however, when I am using</p>

<pre><code>array.each do |a|
    puts a
end
</code></pre>

<p>I am getting as a result a double line of the form:</p>

<pre><code>result after puts
(empty line)
result after puts etc
</code></pre>

<p>when my preferred result is a single line of the form:</p>

<pre><code>result after puts
result afters puts etc
</code></pre>

<p>I tried to perform this with print, but I am getting:</p>

<pre><code>result after puts result after puts etc
</code></pre>

<p>in a single line.</p>

<p>Can you please help me?</p>