Skip to content

Instantly share code, notes, and snippets.

Last active Feb 3, 2018
What would you like to do?
#if os(Linux)
import Glibc
import Darwin
extension String {
func contains(s: String, caseSensitive: Bool = true) -> Bool {
if !caseSensitive { return lowercaseString.contains(s.lowercaseString) }
return characters
.contains { tail in tail.startsWith(s.characters) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment