/InsensitiveString-Swift

Short syntax to compare strings ignoring case.

Primary LanguageSwiftMIT LicenseMIT

Usage

Prefix any string with ^ to make it case insensitive. Comparison with other strings will use Swift's localizedCaseInsensitiveCompare function under the hood:

let fileExtension = "JPG"

let message: String

switch ^fileExtension {
case "jpg":
    message = "It's a jpg!"
default:
    message = "It's not a jpg!"
}