I’m trying to create a single ‘query’ NSString object that basically looks like this:
query1=myFirstParameter&query2=mySecondParameter&query3=myThirdParameter
ive got strings that look like this:
query1=myFirstParameter
query2=mySecondParameter
and
query3=myThirdParameter
my question is this: is there an easy way to combine these 3 components by adding a ? character between them considering the number of strings is variable? i.e., a simple string with format is too inflexible for my purposes.
Well, if you have a variable number of strings to concatenate, you can just make them an array and join them by the
@"&"string:You can even make this into a variadic macro: