Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
NSStringが変数に格納されていて、常に10番目の文字まで文字列を保持し、残りを削除したいとします。Objective-Cでそれを行うにはどうすればよいですか?
NSMutableString *tmp = [NSMutableString stringWithString:@"012346578901234567890"]; [tmp replaceCharactersInRange:NSMakeRange(10, tmp.length-10) withString:@""]; NSLog(@"tmp : %@",tmp);