Skip to content

Commit 870dae5

Browse files
xwunatecook1000
authored andcommitted
[docs] hasPrefix and hasSuffix don't match scalars (#22056)
1 parent b7f3697 commit 870dae5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

stdlib/public/core/StringLegacy.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ extension StringProtocol {
6464
/// print(cafe.hasPrefix("café"))
6565
/// // Prints "false"
6666
///
67-
/// The Unicode-safe comparison matches Unicode scalar values rather than the
68-
/// code points used to compose them. The example below uses two strings
69-
/// with different forms of the `"é"` character---the first uses the composed
70-
/// form and the second uses the decomposed form.
67+
/// The Unicode-safe comparison matches Unicode extended grapheme clusters
68+
/// rather than the code points used to compose them. The example below uses
69+
/// two strings with different forms of the `"é"` character---the first uses
70+
/// the composed form and the second uses the decomposed form.
7171
///
7272
/// // Unicode safe
7373
/// let composedCafe = "Café"
@@ -98,10 +98,10 @@ extension StringProtocol {
9898
/// print(plans.hasSuffix("Café"))
9999
/// // Prints "false"
100100
///
101-
/// The Unicode-safe comparison matches Unicode scalar values rather than the
102-
/// code points used to compose them. The example below uses two strings
103-
/// with different forms of the `"é"` character---the first uses the composed
104-
/// form and the second uses the decomposed form.
101+
/// The Unicode-safe comparison matches Unicode extended grapheme clusters
102+
/// rather than the code points used to compose them. The example below uses
103+
/// two strings with different forms of the `"é"` character---the first uses
104+
/// the composed form and the second uses the decomposed form.
105105
///
106106
/// // Unicode safe
107107
/// let composedCafe = "café"

0 commit comments

Comments
 (0)