我有一个NSMutableString,需要在其中的两个位置插入另一个NSString。我的NSMutableString是:
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="];
我需要在"question_num="后插入一个字符串(One),在"ansValue="后插入另一个字符串(One),这样我的最终字符串应该像这样:http://lmsstaging.com/services/ParticipantService.cfc?method=setVideoExamResults&student_id=10082&course_id=VRT_TRA&lesson=904&examtype=r&question_num=One&ansValue=One。 对此有什么建议吗?
NSString
时使用了stringWithFormat:
,然后将其传递给NSMutableString
的initWithString:
,而不是直接使用NSMutableString
的initWithFormat:
呢? - mttrb