Character category propertiesBasics article available: Strings
I absolutely love the many different category properties that were added to Swift’s
Character type as part of Swift 5.0. I’ve been writing a ton of string parsing code lately, and these properties have been so incredibly useful.
let character: Character = "A" character.isLetter // true character.isNumber // false character.isUppercase // true character.isSymbol // false character.isCurrencySymbol // false character.isASCII // true
Support Swift by Sundell by checking out this sponsor:
Raycast: Take the macOS Spotlight experience to the next level: Create Jira issues, manage GitHub pull requests and control other tools with a few keystrokes. Easily automate every-day tasks and boost your developer productivity by downloading Raycast for free.