比如:传入 @"welcom to zhongguo" 返回:3
*/
- (NSUInteger)countOfWordInString:(NSString *)str
/*
2.已知字符串中有各种字符,返回出现次数最多的字符。如果某些字符个数相同,返回ASIIC码最大的那个。(15分)
*/
- (unichar) mostCharacterInString:(NSString *)str
/*
3.传入一个字符串,判断字符串是否是合法邮箱,是,返回YES,不是返回NO。(15分)
mail@1000phone.com 是
$mail@1000phone.com 不是
*/
- (BOOL) isMailString:(NSString *)str
/*
4.把字符串中的字母大小写反转(10分)
将字符数组s中每个字母大写变成小写,小写变成大写,其他字符不动。
*/
- (NSString *)reverseString:(NSString *)str
/*
5.为NSArray添加方法,返回一个字典,将数组中的索引序号转换成字符串作为key,将元素内容转换为值。(15分)
如:数组元素为@[@"Zero", @"One", @"Two", @"Three"]
返回:{@"0":@"Zero", @"1":@"One", @"2":@"Two", @"3":@"Three"}
*/
- (NSDictionary *)dictionaryFromArray:(NSArray *)array
/*
6.将字符串中单词后移(15分)
已知字符串中的单词以空格隔开,将字符串向右移动指定单词数,首尾循环
如:string传入@"Hi man welcome to zhongguo", step传入2
返回:@"to zhongguo Hi man welcome"
*/
- (NSString *)string:(NSString *)originalStr righMoveStep:(NSUInteger)step
/*
7.根据输入的内容打印(20分)
比如 [obj print:@"12345"];
12345
2
3
4
12345
*/
- (void)printString:(NSString *)string