NSString-DamerauLevenshtein
全部标签 我想知道如何将NSMutableArray中的对象中找到的字符串大写。NSArray在索引2处包含字符串'April'。我希望将其更改为'APRIL'。有这样简单的东西吗?viewNoteDateMonth.text=[[displayDateobjectAtIndex:2]capitalized]; 最佳答案 来吧:viewNoteDateMonth.text=[[displayDateobjectAtIndex:2]uppercaseString];顺便说一句:"april"是小写➔[NSStringlowercaseStrin
我想知道如何将NSMutableArray中的对象中找到的字符串大写。NSArray在索引2处包含字符串'April'。我希望将其更改为'APRIL'。有这样简单的东西吗?viewNoteDateMonth.text=[[displayDateobjectAtIndex:2]capitalized]; 最佳答案 来吧:viewNoteDateMonth.text=[[displayDateobjectAtIndex:2]uppercaseString];顺便说一句:"april"是小写➔[NSStringlowercaseStrin
我正在实现推送通知。我想将我的APNStoken保存为字符串。-(void)application:(UIApplication*)applicationdidRegisterForRemoteNotificationsWithDeviceToken:(NSData*)newDeviceToken{NSString*tokenString=[NSStringstringWithUTF8String:[newDeviceTokenbytes]];//[[NSStringalloc]initWithData:newDeviceTokenencoding:NSUTF8StringEncodi
我正在实现推送通知。我想将我的APNStoken保存为字符串。-(void)application:(UIApplication*)applicationdidRegisterForRemoteNotificationsWithDeviceToken:(NSData*)newDeviceToken{NSString*tokenString=[NSStringstringWithUTF8String:[newDeviceTokenbytes]];//[[NSStringalloc]initWithData:newDeviceTokenencoding:NSUTF8StringEncodi
我有一个这样的字符串:@"10/04/2011"我只想将“10”保存在另一个字符串中。我该怎么做? 最佳答案 NSArray*foo=[@"10/04/2011"componentsSeparatedByString:@"/"];NSString*firstBit=[fooobjectAtIndex:0];2018年7月3日更新:既然问题已经获得了Swift标签,我应该添加Swift的方式来执行此操作。就这么简单:letsubstrings="10/04/2011".split(separator:"/")letfirstBit=s
我有一个这样的字符串:@"10/04/2011"我只想将“10”保存在另一个字符串中。我该怎么做? 最佳答案 NSArray*foo=[@"10/04/2011"componentsSeparatedByString:@"/"];NSString*firstBit=[fooobjectAtIndex:0];2018年7月3日更新:既然问题已经获得了Swift标签,我应该添加Swift的方式来执行此操作。就这么简单:letsubstrings="10/04/2011".split(separator:"/")letfirstBit=s
在Objective-C中标记/拆分NSString的最佳方法是什么? 最佳答案 找到答案here:NSString*string=@"oop:ack:bork:greeble:ponies";NSArray*chunks=[stringcomponentsSeparatedByString:@":"]; 关于objective-c-Objective-C中的NSString标记化,我们在StackOverflow上找到一个类似的问题: https://sta
在Objective-C中标记/拆分NSString的最佳方法是什么? 最佳答案 找到答案here:NSString*string=@"oop:ack:bork:greeble:ponies";NSArray*chunks=[stringcomponentsSeparatedByString:@":"]; 关于objective-c-Objective-C中的NSString标记化,我们在StackOverflow上找到一个类似的问题: https://sta
我正在尝试检查我将用作URL的字符串是否以http开头。我现在尝试检查的方式似乎不起作用。这是我的代码:NSMutableString*temp=[[NSMutableStringalloc]initWithString:@"http://"];if([businessWebsiterangeOfString:@"http"].location==NSNotFound){NSString*temp2=[[NSStringalloc]init];temp2=businessWebsite;[tempappendString:temp2];businessWebsite=temp2;NSL
我正在尝试检查我将用作URL的字符串是否以http开头。我现在尝试检查的方式似乎不起作用。这是我的代码:NSMutableString*temp=[[NSMutableStringalloc]initWithString:@"http://"];if([businessWebsiterangeOfString:@"http"].location==NSNotFound){NSString*temp2=[[NSStringalloc]init];temp2=businessWebsite;[tempappendString:temp2];businessWebsite=temp2;NSL