Hi Friends,
I was in a search of a function that would give the number of occurrences of a character or a string in another string and finally I landed in the following solution. If you have any other way to achieve it, please share it.
+ (NSInteger)occurrencesOf:(NSString *)str InString:(NSString *)mainString
{
return [[mainString componentsSeparatedByString:str] count];
}
Thank you.
What should Indian Policemen get?
-
When we think of an average indian Policemen, who is obese and who demand
bribes and with many great traits, we do feel that they are not the kind of
offic...
1 year ago
0 comments:
Post a Comment