Creates a String having the given content.
SDK
- Xcode 9.0+
Framework
- Swift Standard Library
Declaration
Discussion
Complexity: O(N), where N is the length of the resulting String
’s UTF-16.
Creates a String having the given content.
SDK
Framework
Complexity: O(N), where N is the length of the resulting String
’s UTF-16.
var unicode Scalars: String .Unicode Scalar View
The string’s value represented as a collection of Unicode scalar values.
init(String .Unicode Scalar View)
Creates a string corresponding to the given collection of Unicode scalars.
var utf16: String .UTF16View
A UTF-16 encoding of self
.
init(String .UTF16View)
Creates a string corresponding to the given sequence of UTF-16 code units.
init?(Substring .UTF16View)
Creates a String having the given content.
var utf8: String .UTF8View
A UTF-8 encoding of self
.
init(String .UTF8View)
Creates a string corresponding to the given sequence of UTF-8 code units.
init?(Substring .UTF8View)
Creates a String having the given content.