title: Objective-C: Removing trailing comma from NSString in a loop
body: <p>This is a simple challenge in my introductory Objc class that is causing my a lot of grief. I've tried a few things I picked up in the X-code API to try to fix this but I'm having no luck. The challenge specifications include a restriction: I cannot change any code outside the for loop and my output cannot include a trailing comma. In its current iteration it does, and I don't know how to get rid of it!</p>
  
  <p>Here is the code in its current form:</p>
  
  <pre><code>    NSString *outputString = @"";
      int loopMaximum = 10;
  
      for (int counter = 1; counter &lt;= loopMaximum; counter++) {
          outputString = [NSString stringWithFormat:@"%@ %d,", outputString, counter];
          //Not sure how to get rid of trailing comma =/
      }
  
      NSLog(@"%@", outputString);
  </code></pre>