This textual representation is used when values are written to an
output stream, for example, by print.
Note:String(instance) will work for an instance of any
type, returning its description if the instance happens to be
CustomStringConvertible. Using CustomStringConvertible as a
generic constraint, or accessing a conforming type's description
directly, is therefore discouraged.
See Also:String.init<T>(T), CustomDebugStringConvertible
A type with a customized textual representation.
This textual representation is used when values are written to an output stream, for example, by
print
.Note:
String(instance)
will work for aninstance
of any type, returning itsdescription
if theinstance
happens to beCustomStringConvertible
. UsingCustomStringConvertible
as a generic constraint, or accessing a conforming type'sdescription
directly, is therefore discouraged.See Also:
String.init<T>(T)
,CustomDebugStringConvertible