title: How to remove the last character in the loop
body: <p>I was trying to remove the last comma in the loop so it wouldn't show the extra comma on the last part. Already tried experimenting bunch of times on the code but it does not work at all.</p>
  
  <pre><code>System.out.println("--Unsorted Array--");
    for(int i = 0; i &lt; mergeS.length; i++){
      System.out.print(mergeS[i]);
      for(int j = 0; j &lt; 1; j+=mergeS[i]-1){
        System.out.print(", ");
    }
  }
  </code></pre>
  
  <p>My expected output is 95, 85, 75, 65, 55
  but the actual output is 95, 85, 75, 65, 55,</p>