splash/Sources/Splash/Extensions/CharacterSet/CharacterSet+Contains.swift

18 lines
335 B
Swift
Raw Permalink Normal View History

2018-08-24 18:42:07 +02:00
/**
* Splash
* Copyright (c) John Sundell 2018
* MIT license - see LICENSE.md
*/
import Foundation
internal extension CharacterSet {
func contains(_ character: Character) -> Bool {
guard let scalar = character.unicodeScalars.first else {
return false
}
return contains(scalar)
}
}