How do I add a space between two concatenated NSStrings?
- by ChrisR
I have three string objects:
NSString *firstName;
NSString *lastName;
NSString *fullName;
The values for firstName and lastName are received from NSTextFields.
I then want to concatenate the two strings and place the result in fullname.
This is the code that I'm using:
fullName = [firstName stringByAppendingString:lastName];
However, the result does not put a space between the two names (e.g. JohnSmith).
How do I add in the space? I'd like the result to look like (John Smith).