You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome to Apple Swift version 4.0.2 (swiftlang-900.0.69.1 clang-900.0.38). Type :help for assistance.
1> let c1: Character = "a"
c1: Character = {
_representation = smallUTF16 {
smallUTF16 = 97
}
}
Two scalars but one character
2> let c2: Character = "a\u{0300}"
c2: Character = {
_representation = smallUTF16 {
smallUTF16 = 50331745
}
}
Five scalars but one character (black man shrugging emoji)
3> let c3: Character = "\u{1F937}\u{1F3FF}\u{200D}\u{2642}\u{FE0F}"
c3: Character = {
_representation = large {
large = {
_nativeBuffer = 0x8000000100403670
}
}
}
Two characters
4> let c4: Character = "ab"
error: repl.swift:4:21: error: cannot convert value of type 'String' to specified type 'Character'
let c4: Character = "ab"
^~~~