How to append a character at the end of string?
<p>I have a string <code>foo:</code>
I want to append a character at the end of a string <code>[</code>
So the final output should be <code>foo: [</code> </p>

<p>I tried the following code.</p>

<p><code>puts 'foo: ' &lt;&lt; '['</code> &amp;
<code>puts 'foo: ' + '['</code>  </p>

<p>But both are appending the character in a new line &amp; giving me the following output.</p>

<p><code>foo:
[</code></p>

<p>However, I want to append the character in the same line &amp; want the below output:</p>

<p><code>foo: [</code></p>