title: How do I add a character to the beginning and end of a String?
body: <pre><code>while ((output = br.readLine()) != null) {
      System.out.println(output);
  }
  </code></pre>
  
  <p>Hi, I have this while loop. This output variable is a String variable and it's keeping the output from <code>br.readLine())</code>.</p>
  
  <p>Let's say <code>br.readLine())</code> is giving 2 lines. </p>
  
  <p>So <code>System.out.println(output);</code> is printing those lines as:</p>
  
  <pre><code>AAA
  BBB
  CCC
  DDD
  </code></pre>
  
  <p>Can somebody tell me how to add a <code>{</code> at the begining of the first line and at the end of the last line? Like this:</p>
  
  <pre><code>{AAA
  BBB
  CCC
  DDD}
  </code></pre>
  
  <p>I tried this by doing something like this:</p>
  
  <pre><code>while ((output = br.readLine()) != null) {
      System.out.println("{"+output+"}");
  }
  </code></pre>
  
  <p>This added a bracket after each line.</p>
  
  <p>Please help me with this.</p>