mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Fixed bugs with string views
Fixes rdar://problem/18435682 Fixes rdar://problem/19238102 Swift SVN r24117
This commit is contained in:
@@ -28,7 +28,8 @@ extension String {
|
||||
/// A collection of `Unicode scalar values
|
||||
/// <http://www.unicode.org/glossary/#unicode_scalar_value>`_ that
|
||||
/// encode a `String` .
|
||||
public struct UnicodeScalarView : Sliceable, SequenceType, Reflectable {
|
||||
public struct UnicodeScalarView : Sliceable, SequenceType, Reflectable,
|
||||
Printable, DebugPrintable {
|
||||
init(_ _core: _StringCore) {
|
||||
self._core = _core
|
||||
}
|
||||
@@ -210,6 +211,14 @@ extension String {
|
||||
return _UnicodeScalarViewMirror(self)
|
||||
}
|
||||
|
||||
public var description: String {
|
||||
return String(_core[self.startIndex._position..<self.endIndex._position])
|
||||
}
|
||||
|
||||
public var debugDescription: String {
|
||||
return "StringUnicodeScalarView(\(self.description.debugDescription))"
|
||||
}
|
||||
|
||||
var _core: _StringCore
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user