mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
stdlib/printing: add Streamable conformance to CString, and DebugPrintable
conformances to String and CString Swift SVN r18003
This commit is contained in:
@@ -88,6 +88,16 @@ extension String : StringLiteralConvertible {
|
||||
}
|
||||
}
|
||||
|
||||
extension String : DebugPrintable {
|
||||
var debugDescription: String {
|
||||
var result = "\""
|
||||
for us in self.unicodeScalars {
|
||||
result += us.escape()
|
||||
}
|
||||
result += "\""
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
extension String {
|
||||
/// \brief return the number of code units occupied by this string
|
||||
|
||||
Reference in New Issue
Block a user