I want to create a comma-separated string like this.
NSString *list = @”iPhone,iPad,iPod”;
I tried like this,
[strItemList appendString:[NSString stringWithFormat:@"%@,", [[arrItems objectAtIndex:i]objectForKey:@"ItemList"]]];
But the issue is I’m getting a string like this
@”iPhone,iPad,iPod,” Note that there is an extra comma “,” at the end of the string. How can I avoid that extra comma?
Can you please give me a hint. Highly appreciated
Thanks in advance
After Completion of loop add below stmt