//.现有如下定义的字符串: NSString *str=@“itheimaAndroid”,能对该字符串进行修改请输出删除Android后的新字符串;
#import <Foundation/Foundation.h>
int main()
{
// 创建已知字符串
NSString *str=@"itheimaAndroid";
NSMutableString *str1;
str1 = [[NSMutableString alloc]initWithFormat:@"%@",str];
NSRange range = [str1 rangeOfString:@"Android"];
[str1 deleteCharactersInRange:range];
NSLog(@"%@",str1);
return 0;
}
|
|