例えば:
NSString *sentence = @"My name is Roman";
NSString *name = @"Roman";
nameのテキストを文字列から削除する方法はありsentenceますか?
例えば:
NSString *sentence = @"My name is Roman";
NSString *name = @"Roman";
nameのテキストを文字列から削除する方法はありsentenceますか?
NSString* result = [sentence stringByReplacingOccurrencesOfString:name withString:@""];
はい
sentence = [sentence stringByReplacingOccurrencesOfString:name withString:@""];
substringWithRange:または、次のように使用できます。
NSString *finalString = [文 substringWithRange:NSMakeRange(3, 16)];