init(_:)
Creates a character containing the given Unicode scalar value.
init(_ content: Unicode.Scalar) Parameters
- content
The Unicode scalar value to convert into a character.
Creates a character containing the given Unicode scalar value.
init(_ content: Unicode.Scalar) The Unicode scalar value to convert into a character.
import Swift@frozen struct CharacterA single extended grapheme cluster that approximates a user-perceived character.
@frozen enum UnicodeA namespace for Unicode utilities.
@frozen struct ScalarA Unicode scalar value.
init(_ s: String) Creates a character from a single-character string.
init(extendedGraphemeClusterLiteral value: Character) Creates a character with the specified value.
var asciiValue: UInt8? { get }The ASCII encoding value of this character, if it is an ASCII character.
var customMirror: Mirror { get }A mirror that reflects the Character instance.
var debugDescription: String { get }A textual representation of the character, suitable for debugging.
var description: String { get }var hexDigitValue: Int? { get }The numeric value this character represents, if it is a hexadecimal digit.
var isASCII: Bool { get }A Boolean value indicating whether this is an ASCII character.
var isCased: Bool { get }A Boolean value indicating whether this character changes under any form of case conversion.
var isCurrencySymbol: Bool { get }A Boolean value indicating whether this character represents a currency symbol.
var isHexDigit: Bool { get }A Boolean value indicating whether this character represents a hexadecimal digit.
var isLetter: Bool { get }A Boolean value indicating whether this character is a letter.
var isLowercase: Bool { get }A Boolean value indicating whether this character is considered lowercase.
var isMathSymbol: Bool { get }A Boolean value indicating whether this character represents a symbol that naturally appears in mathematical contexts.
var isNewline: Bool { get }A Boolean value indicating whether this character represents a newline.
var isNumber: Bool { get }A Boolean value indicating whether this character represents a number.
var isPunctuation: Bool { get }A Boolean value indicating whether this character represents punctuation.
var isSymbol: Bool { get }A Boolean value indicating whether this character represents a symbol.
var isUppercase: Bool { get }A Boolean value indicating whether this character is considered uppercase.
var isWhitespace: Bool { get }A Boolean value indicating whether this character represents whitespace, including newlines.
var isWholeNumber: Bool { get }A Boolean value indicating whether this character represents a whole number.
var unicodeScalars: Character.UnicodeScalarView { get }var utf16: Character.UTF16View { get }A UTF-16 encoding of self.
var utf8: Character.UTF8View { get }A UTF-8 encoding of self.
var wholeNumberValue: Int? { get }The numeric value this character represents, if it represents a whole number.
static func < (lhs: Character, rhs: Character) -> Bool static func == (lhs: Character, rhs: Character) -> Bool func hash(into hasher: inout Hasher) Hashes the essential components of this value by feeding them into the given hasher.
func lowercased() -> String Returns a lowercased version of this character.
func uppercased() -> String Returns an uppercased version of this character.
func write<Target>(to target: inout Target) where Target : TextOutputStream Writes the character into the given output stream.
typealias UTF16View = String.UTF16ViewA view of a character’s contents as a collection of UTF-16 code units. See String.UTF16View for more information
typealias UTF8View = String.UTF8ViewA view of a character’s contents as a collection of UTF-8 code units. See String.UTF8View for more information
typealias UnicodeScalarView = String.UnicodeScalarViewvar customPlaygroundQuickLook: _PlaygroundQuickLook { get }A custom playground Quick Look for the Character instance.