title: Output ArrayList to String without [,] (brackets) appearing
body: <p>OK, so I have an ArrayList that I need to return as a String. Right now I am using this approach:</p>
  
  <pre><code>List&lt;Customer&gt; customers = new ArrayList&lt;&gt;();
  List&lt;Account&gt; accounts = new ArrayList&lt;&gt;();
  
  
  public String customerList() 
  {
      String list = Arrays.toString(customers.toArray()); 
      return list;
  }
  
  public String accountList() 
  { 
      String account = Arrays.toString(accounts.toArray()); 
      return account;
  }
  </code></pre>
  
  <p>This works fine, but the problem is that I get brackets around the text. I am getting stuff like:</p>
  
  <pre><code> Customer list:
   --------------
   [Name: Last, First
   , Name: Last, First
   , Name: Last, First
   ]
  </code></pre>
  
  <p>When I want something like this:</p>
  
  <pre><code> Customer list:
   --------------
   Name: Last, First
   Name: Last, First
   Name: Last, First
  </code></pre>
  
  <p>However, unlike similar questions, I don't simply want to output line by line. I need to store the ArrayList in a String without the brackets so I can work with it.</p>
  
  <p><strong>EDIT:</strong> It should be noted that the one comma in the version I want it to look like was placed there by a method in a different class:</p>
  
  <pre><code>public final String getName()  
      { 
          return getLast() + ", " + getFirst(); 
      }
  </code></pre>
  
  <p><strong>EDIT 2:</strong> I was able to find a complete solution by adapting the two answers I was given. It was difficult deciding which was the "answer" because I found both useful, but went with the one that I could use more selectively.</p>
  
  <pre><code>public String customerList() 
  {
      String list = Arrays.toString(customers.toArray()).replace(", N", "N").replace(", N", "N");
      return list.substring(1,list.length()-1);
  }
  </code></pre>
  
  <p>To remove the brackets I used the modified return. Removing the comma required me to focus on the fact that each line will start with an "N", but the flaw in this approach is that the code would break if I forget to change it here if I change it there. Still, it solves my specific problem, and I can always notate to myself in both places as needed.</p>