I have three string and I want them to concatenate but they are not concatenating. I am using this code.
I want my last string to display like this:
Cerenia Results 12Jun 2012.pdf
like this
NSString *fileName = @"Cerenia Results";
NSString* str = [formatter stringFromDate:date];
NSString*extention=@".pdf";
NSString * strRR = [NSString stringWithFormat:@"Cerenia Results_%@ [%@].pdf", extension];
General case : to concatenate all three strings you should use
NSString * strRR = [NSString stringWithFormat:@"%@%@%@", fileName, str, extension];
Your case:
You can add any formatting you like such as inserting characters in between (to get the results you are after >> Cerenia Results 12Jun 2012.pdf)
[formatter setDateFormat:@"ddMMMyyyy"]
NSString* fileName = @"Cerenia Results";
NSString* str = [formatter stringFromDate:date];
NSString* extension = @"pdf";
NSString* strRR = [NSString stringWithFormat:@"%@ %@.%@", fileName, str, extension];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With