struct UnicodeScalar
Inheritance |
Comparable, CustomDebugStringConvertible, CustomStringConvertible, Equatable, Hashable, Streamable, UnicodeScalarLiteralConvertible, _Reflectable
View Protocol Hierarchy →
|
---|---|
Import | import Swift |
Initializers
Construct with value v
.
Requires: v
is a valid unicode scalar value.
Declaration
init(_ v: Int)
Create an instance with numeric value v
.
Requires: v
is a valid Unicode scalar value.
Declaration
init(_ v: UInt16)
Create an instance with numeric value v
.
Requires: v
is a valid Unicode scalar value.
Declaration
init(_ v: UInt32)
Declaration
init(_builtinUnicodeScalarLiteral value: Builtin.Int32)
Create an instance initialized to value
.
Declaration
init(unicodeScalarLiteral value: UnicodeScalar)
Instance Variables
A textual representation of self
, suitable for debugging.
Declaration
var debugDescription: String { get }
A textual representation of self
.
Declaration
var description: 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
Returns a String representation of self
.
forceASCII
: If true
, forces most values into a numeric
representation.
Declaration
func escape(asASCII forceASCII: Bool) -> String
Returns true
if this is an ASCII character (code point 0 to 127
inclusive).
Declaration
func isASCII() -> Bool
Write a textual representation of self
into target
.
Declaration
func writeTo<Target : OutputStreamType>(inout target: Target)
A Unicode scalar value.