Skip to content

Commit 1ef6001

Browse files
committed
Fixes and unifies outputs of example snippets in CharacterProperties.swift as it was suggested in review to PR
1 parent e1e33b9 commit 1ef6001

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

stdlib/public/core/CharacterProperties.swift

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ extension Character {
3434
/// for ch in chars {
3535
/// print(ch, "-->", ch.asciiValue)
3636
/// }
37-
/// // a --> 97
38-
/// // --> 32
37+
/// // Prints:
38+
/// // a --> Optional(97)
39+
/// // --> Optional(32)
3940
/// // ™ --> nil
4041
///
4142
/// A character with the value "\r\n" (CR-LF) is normalized to "\n" (LF) and
@@ -127,9 +128,10 @@ extension Character {
127128
/// for ch in chars {
128129
/// print(ch, "-->", ch.wholeNumberValue)
129130
/// }
130-
/// // 4 --> 4
131-
/// // ④ --> 4
132-
/// // 万 --> 10000
131+
/// // Prints:
132+
/// // 4 --> Optional(4)
133+
/// // ④ --> Optional(4)
134+
/// // 万 --> Optional(10000)
133135
/// // a --> nil
134136
public var wholeNumberValue: Int? {
135137
guard _isSingleScalar else { return nil }
@@ -158,9 +160,10 @@ extension Character {
158160
/// for ch in chars {
159161
/// print(ch, "-->", ch.hexDigitValue)
160162
/// }
161-
/// // 1 --> 1
162-
/// // a --> 10
163-
/// // F --> 15
163+
/// // Prints:
164+
/// // 1 --> Optional(1)
165+
/// // a --> Optional(10)
166+
/// // F --> Optional(15)
164167
/// // g --> nil
165168
public var hexDigitValue: Int? {
166169
guard _isSingleScalar else { return nil }
@@ -206,6 +209,7 @@ extension Character {
206209
/// for ch in chars {
207210
/// print(ch, "-->", ch.uppercased())
208211
/// }
212+
/// // Prints:
209213
/// // e --> E
210214
/// // é --> É
211215
/// // и --> И
@@ -223,6 +227,7 @@ extension Character {
223227
/// for ch in chars {
224228
/// print(ch, "-->", ch.lowercased())
225229
/// }
230+
/// // Prints:
226231
/// // E --> e
227232
/// // É --> é
228233
/// // И --> и

0 commit comments

Comments
 (0)