title: Simplest way to concatenate objective-C strings and achieve grammatical correctness (with 'and' conjunction)
body: <p>What is the easiest and best way in Objective-C to combine a list (NSArray) of NSStrings into a single NSString separated by commas, with the grammatically correct terminal conjunction ", and " before the final item of the list?</p>
  
  <pre><code>NSArray *anArray = [NSArray arrayWithObjects:@"milk", @"butter", @"eggs", @"spam", nil];
  </code></pre>
  
  <p>From this array,  I want the NSString <code>@"milk, butter, eggs, and spam"</code>. </p>
  
  <p>More generally, if the list is more than two items long, I want <code>", "</code> between every item except the last and second-to-last (which should have <code>", and "</code>). If the list is two items long, I want just the <code>' and '</code> with no comma.  If the list is one item long, I want the single string from the array.</p>
  
  <p>I like something as simple as:</p>
  
  <pre><code>NSString *newString = [anArray componentsJoinedByString:@", "];
  </code></pre>
  
  <p>But this of course omits the 'and' conjunction.</p>
  
  <p>Is there a simpler and/or faster Objective-C way than the following:</p>
  
  <pre><code>- (NSString *)grammaticallyCorrectStringFromArrayOfStrings:(NSArray *)anArray {
      if (anArray == nil) return nil;
      int arrayCount = [anArray count];
      if (arrayCount == 0) return @"";
      if (arrayCount == 1) return [anArray objectAtIndex:0];
      if (arrayCount == 2) return  [anArray componentsJoinedByString:@" and "];
  
      // arrayCount &gt; 2
      NSString *newString = @"";
      for (NSString *thisString in anArray) {
          if (thisString != [anArray objectAtIndex:0] &amp;&amp; thisString != [anArray lastObject]) {
              newString = [newString stringByAppendingString:@", "];
          }
          else if (thisString == [anArray lastObject]) {
              newString = [newString stringByAppendingString:@", and "];
          }
          newString = [newString stringByAppendingString:thisString];
      }
      return newString;
  }
  </code></pre>