init(Unicode.Scalar)
Creates a character containing the given Unicode scalar value.
与えられたユニコードスカラー値を含んでいるひとつの文字を作成します。
var isASCII : Bool
A Boolean value indicating whether this is an ASCII character.
それがASCII文字かどうかを指し示しているブール値。
Availability
Technology
var asciiValue: UInt8
? { get }
let chars: [Character] = ["a", " ", "™"]
for ch in chars {
print(ch, "-->", ch.asciiValue)
}
// Prints:
// a --> Optional(97)
// --> Optional(32)
// ™ --> nil
A character with the value “\r\n” (CR-LF) is normalized to “\n” (LF) and has an ascii
property equal to 10.
値 “\r\n” (CR-LF) を持つある文字は、“\n” (LF) に正規化されます、そして10に等しいascii
プロパティを持ちます。
let cr = "\r" as Character
// cr.asciiValue == 13
let lf = "\n" as Character
// lf.asciiValue == 10
let crlf = "\r\n" as Character
// crlf.asciiValue == 10
init(Unicode.Scalar)
var isASCII : Bool