NSString category to count the number of occurrences for a given substring.
Objective-C Shell Ruby C
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Classes
Tests
.travis.yml
LICENSE
NSString+VTSubstringOccurrences.podspec
README.md

README.md

NSString+VTSubstringOccurrences

NSString category to count the number of occurrences for a given substring.

Build Status

How to install

Available on CocoaPods. CocoaPods version badge  CocoaPods platform badge

pod 'NSString+VTSubstringOccurrences'

How to use

NSString *string = @"Cake stuff and spacecakes.";
[string vt_numberOfOccurrencesForSubstring:@"cake"]; // = 1
[string vt_numberOfOccurrencesForSubstring:@"cake" options:NSCaseInsensitiveSearch]; // = 2

Credits

NSString+VTSubstringOccurrences was created by Vincent Tourraine.

License

NSString+VTSubstringOccurrences is available under the MIT license. See the LICENSE file for more info.