Question: I would like to change it to first name and last initial. 

Thanks!

Answer: 
```
NSString* nameStr = @"Firstname Lastname";
NSArray* firstLastStrings = [nameStr componentsSeparatedByString:@" "];
NSString* firstName = [firstLastStrings objectAtIndex:0];
NSString* lastName = [firstLastStrings objectAtIndex:1];
char lastInitialChar = [lastName characterAtIndex:0];
NSString* newNameStr = [NSString stringWithFormat:@"%@ %c.", firstName, lastInitialChar];

```

This could be much more concise, but I wanted clarity for the OP :) Hence all the interim variables and var names.
Get an array of the parts of the name individually:

```
NSString *sourceName = ...whatever...;

NSArray *nameComponents =
    [sourceName
        componentsSeparatedByCharactersInSet:
            [NSCharacterSet whitespaceCharacterSet]];

```

Then, I guess:

```
NSString *compactName =
    [NSString stringWithFormat:@"%@ %@.",
        [nameComponents objectAtIndex:0],
        [[nameComponents lastObject] substringToIndex:1]];

```

That'll skip any middle names, though if there's only one name, like say 'Jeffry' then it'll output 'Jeffry J.'. If you pass in the empty string then it'll raise an exception when you attempt to get `objectAtIndex:0` since that array will be empty. So you should check `[nameComponents count]`.