Articles and podcasts about Swift development, by John Sundell.

Genius Scan SDK

Presented by the Genius Scan SDK

This article has been archived, as it was published several years ago, so some of its information might now be outdated. For more recent articles, please visit the main article feed.

Character category properties

Published on 23 Jul 2019
Basics 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
Genius Scan SDK

Swift by Sundell is brought to you by the Genius Scan SDK — Add a powerful document scanner to any mobile app, and turn scans into high-quality PDFs with one line of code. Try it today.