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

Thanks!

Answer: 
You can use this code snippet, first separate string using `componentsSeparatedByString`, then join them again but only get the first character of `Lastname`

```
NSString *str = @"Firstname Lastname";
NSArray *arr = [str componentsSeparatedByString:@" "];
NSString *newString = [NSString stringWithFormat:@"%@ %@.", [arr objectAtIndex:0], [[arr objectAtIndex:1] substringToIndex:1]];

```
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]`.