title: Converting string[] into comma separated string.
body: <p>I have a string array which i need to parse it to long variable.</p>
  
  <p>The string array contains values as ["9", "8"] etc.
  I want to convert this to "(9,8)" (I am using it in the "IN" clause of an SQL statement).</p>
  
  <p>What is a good way to accomplish this?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>String[] statusIdArray;
  long statsId = Long.parseLong("(");
  statsId = Long.parseLong(statusIdArray[0]);
    for(int i=1; i &lt; len; i++) {
      statsId = Long.parseLong(statsId + ",") statsId=Long.parseLong(statsId + statusIdArray[i]);
      statsId = Long.parseLong(statsId + ")");
    }
  </code></pre>
  
  <p>But I get a NumberFormatException <code>at input string "(9"</code></p>