Skip to content

WilhelmOks/InsensitiveString-Swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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!"
}

About

Short syntax to compare strings ignoring case.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages