名稱:字串相加
語法:[string1 stringByAppendingString:string2]
說明:這個的好處就是....可以一直無限加下去
<以下範例>
NSString *string1 = @"n"; NSString *string2 = [[NSString alloc] initWithFormat:@"studio"]; string1 = [[string1 stringByAppendingString:@"11 "] stringByAppendingString:string2]; NSLog(@"%@",string1); //the answer is "n11 studio"
沒有留言:
張貼留言