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

Thanks!

Answer: 
This would do it:

```
NSArray *components = [fullname componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
NSString *firstnameAndLastnameInitial = [NSString stringWithFormat:@"%@ %@.", [components objectAtIndex:0], [[components objectAtIndex:1] substringToIndex:1]];

```

This assumes that fullname is an instance of NSString and contains two components separated by whitespace, so you will need to check for that as well.
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]`.