Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vtourraine/nsstring-vtsubstringoccurrences
NSString category to count the number of occurrences for a given substring.
https://github.com/vtourraine/nsstring-vtsubstringoccurrences
Last synced: about 1 month ago
JSON representation
NSString category to count the number of occurrences for a given substring.
- Host: GitHub
- URL: https://github.com/vtourraine/nsstring-vtsubstringoccurrences
- Owner: vtourraine
- License: mit
- Created: 2014-04-16T09:25:35.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2021-02-01T13:56:26.000Z (almost 4 years ago)
- Last Synced: 2024-11-14T16:44:45.494Z (about 2 months ago)
- Language: Objective-C
- Homepage:
- Size: 55.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NSString+VTSubstringOccurrences
_`NSString` category to count the number of occurrences for a given substring._
[![Build Status](https://travis-ci.org/vtourraine/NSString-VTSubstringOccurrences.svg?branch=master)](https://travis-ci.org/vtourraine/NSString-VTSubstringOccurrences)
## How to install
Available on CocoaPods. ![CocoaPods version badge](https://cocoapod-badges.herokuapp.com/v/NSString+VTSubstringOccurrences/badge.png)
![CocoaPods platform badge](https://cocoapod-badges.herokuapp.com/p/NSString+VTSubstringOccurrences/badge.png)``` ruby
pod 'NSString+VTSubstringOccurrences'
```## How to use
``` objc
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](http://www.vtourraine.net).
## License
NSString+VTSubstringOccurrences is available under the MIT license. See the LICENSE file for more info.