How to insert a NSString into a NSMutableString?
ios5, iphone, nsmutablestring, nsstring, objective-c
Solution
Try this:
NSMutableString *webServiceLinkWithResponses = [[NSMutableString alloc] initWithString:[NSString stringWithFormat: @"http://lmsstaging.2xprime.com/services/ParticipantService.cfc?method=setVideoExamResults&student_id=10082&course_id=VRT_TRA&lesson=904&examtype=r&question_num=%@&ansValue=%@",yourFirstString,yourSecondString];
Tell me if it helps!
Problem
I have a NSMutableString where i need to insert another NSString at two places. My NSMutableString is ``` NSMutableString *webServiceLinkWithResponses = [[NSMutableString alloc] initWithString:@"http://lmsstaging.2xprime.com/services/ParticipantService.cfc?method=setVideoExamResults&student_id=10082&course_id=VRT_TRA&lesson=904&examtype=r&question_num=&ansValue="]; ``` I need to insert one String(One) after "question_num=" and another string(One) after "ansValue=" so my final string should be like http://lmsstaging.com/services/ParticipantService.cfc?method=setVideoExamResults&student_id=10082&course_id=VRT_TRA&lesson=904&examtype=r&question_num=One&ansValue=One Any suggestions on this?