Instance Method

uppercased()

Returns an uppercased version of this character.

Declaration

func uppercased() -> String

Discussion

Because case conversion can result in multiple characters, the result of uppercased() is a string.

let chars: [Character] = ["e", "é", "и", "π", "ß", "1"]
for ch in chars {
    print(ch, "-->", ch.uppercased())
}
// e --> E
// é --> É
// и --> И
// π --> Π
// ß --> SS
// 1 --> 1

See Also

Checking a Character’s Case

var isCased: Bool

A Boolean value indicating whether this character changes under any form of case conversion.

var isUppercase: Bool

A Boolean value indicating whether this character is considered uppercase.

var isLowercase: Bool

A Boolean value indicating whether this character is considered lowercase.

func lowercased() -> String

Returns a lowercased version of this character.