Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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.