I am trying to concatenate a few NSStrings but would like to exclude the ones that are nulls. I am using this solution:
[NSString stringWithFormat:@"%@/%@/%@", three, two, one];
but what if one of the string is null? I’d like to exclude it. any ideas?
thanks.
You could do:
Or better would probably be to have a mutable string and build it up: