Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/vtourraine/nsstring-vtcontainssubstring

NSString category to test the presence of a given substring.
https://github.com/vtourraine/nsstring-vtcontainssubstring

Last synced: about 2 months ago
JSON representation

NSString category to test the presence of a given substring.

Awesome Lists containing this project

README

        

# NSString+VTContainsSubstring

_`NSString` category to test the presence of a given substring._

[![Build Status](https://travis-ci.org/vtourraine/NSString-VTContainsSubstring.svg?branch=master)](https://travis-ci.org/vtourraine/NSString-VTContainsSubstring)

Starting with OS X 10.10 and iOS 8, `NSString` now offers a `containsString:` convenience method. The `vt_containsSubstring:` method is compatible with earlier versions, and is slightly more customizable with its `options` parameter.

## How to install

Available on CocoaPods. ![CocoaPods version badge](https://cocoapod-badges.herokuapp.com/v/NSString+VTContainsSubstring/badge.png) 
![CocoaPods platform badge](https://cocoapod-badges.herokuapp.com/p/NSString+VTContainsSubstring/badge.png)

``` ruby
pod 'NSString+VTContainsSubstring'
```

## How to use

``` objc
NSString *string = @"I like cakes.";
[string vt_containsSubstring:@"cake"]; // = YES
[string vt_containsSubstring:@"Cake" options:NSCaseInsensitiveSearch]; // = YES
```

## Credits

NSString+VTContainsSubstring was created by [Vincent Tourraine](http://www.vtourraine.net).

## License

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