My string is comma separated.First I want to check for a string containing a comma or not. In my application line as below:
NSString * str=@ "1,2,3";
How to check this comma or not?
I solved my problem using the following code:
NSString * str=@ "1,2,3"; NSArray *result=[str componentsSeparatedByString:@","]; if([result count]!=0) { NSLog(@"String contains comma"); }
Source: https://habr.com/ru/post/1444544/More articles:Socket connection timeouts: where is the specification? - javaHow to get all messages using tumblr API or Tumblr Rss feed - fetchHow to track user conversion rate in iTunes affiliate link in iOS app - iosAdd watermark image to android - androidHow to find out what type of exception to catch in python? - pythonHow to parse date and time with undefined timezone in Java? - javaA typedef template without re-configuring the template. Use template class parameter as a template - c ++SQL Server: can I save binary data in nvarchar column? - sql-serverandroid NDK, use functions from the compiled .so library in another Android NDK project - androidHow to create a database connection between two oracle instances - oracleAll Articles