Objective-Cの中で可変文字列(NSMutableString)の良く利用方法

1.文字列を挿入
NSMutableString *string19=[[NSMutableString alloc]initWithFormat:@"startnews24_welcome"];
[string19 insertString:@"soft" atIndex:2];
NSLog(@"%@",string19);

2.文字列を置換
[string19 replaceCharactersInRange:NSMakeRange(0, 3) withString:@"startnews24″];
NSLog(@"%@",string19);

3.文字列を削除
[string19 deleteCharactersInRange:NSMakeRange(0, 3)];

 

 

IOS

Posted by arkgame