struct Character
Inheritance |
Comparable, CustomDebugStringConvertible, Equatable, ExtendedGraphemeClusterLiteralConvertible, Hashable, Streamable, UnicodeScalarLiteralConvertible, _Reflectable
View Protocol Hierarchy →
|
---|---|
Import | import Swift |
Initializers
Create an instance from a single-character String
.
Requires: s
contains exactly one extended grapheme cluster.
Declaration
init(_ s: String)
Construct a Character
containing just the given scalar
.
Declaration
init(_ scalar: UnicodeScalar)
Declaration
init(_builtinExtendedGraphemeClusterLiteral start: Builtin.RawPointer, byteSize: Builtin.Word, isASCII: Builtin.Int1)
Declaration
init(_builtinUnicodeScalarLiteral value: Builtin.Int32)
Create an instance initialized to value
.
Declaration
init(extendedGraphemeClusterLiteral value: Character)
Create an instance initialized to value
.
Declaration
init(unicodeScalarLiteral value: Character)
Instance Variables
A textual representation of self
, suitable for debugging.
Declaration
var debugDescription: String { get }
The hash value.
Axiom: x == y
implies x.hashValue == y.hashValue
.
Note: The hash value is not guaranteed to be stable across different invocations of the same program. Do not persist the hash value across program runs.
Declaration
var hashValue: Int { get }
Instance Methods
Write a textual representation of self
into target
.
Declaration
func writeTo<Target : OutputStreamType>(inout target: Target)
Character
represents some Unicode grapheme cluster as defined by a canonical, localized, or otherwise tailored segmentation algorithm.