Skip to content

Commit dafe368

Browse files
committed
Address @dabrahams’s feedback
1 parent f650e0a commit dafe368

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

stdlib/public/core/Arrays.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ if True:
170170
"""
171171
elif Self == 'Array':
172172
SelfDocComment = '''\
173-
/// An ordered, random-access collection of elements of a single type.
173+
/// An ordered, random-access collection.
174174
///
175175
/// Arrays are one of the most commonly used data types in an app. You use
176176
/// arrays to organize your app's data. Specifically, you use the `Array` type

stdlib/public/core/Character.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
/// count the length of a string.
2222
///
2323
/// let greeting = "Hello! 🐥"
24-
/// print("Character count: \(greeting.count)")
25-
/// // Prints "Character count: 8"
24+
/// print("Length: \(greeting.count)")
25+
/// // Prints "Length: 8"
2626
///
2727
/// Because each character in a string can be made up of one or more Unicode
2828
/// code points, the number of characters in a string may not match the length

stdlib/public/core/Collection.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -502,27 +502,23 @@ public struct IndexingIterator<
502502
/// ================================
503503
///
504504
/// You can access a slice of a collection through its ranged subscript or by
505-
/// calling methods like `prefix(_:)` or `suffix(from:)`. A slice of a
505+
/// calling methods like `prefix(while:)` or `suffix(_:)`. A slice of a
506506
/// collection can contain zero or more of the original collection's elements
507507
/// and shares the original collection's semantics.
508508
///
509509
/// The following example creates a `firstWord` constant by using the
510-
/// `prefix(_:)` method to get a slice of the `text` string.
510+
/// `prefix(where:)` method to get a slice of the `text` string.
511511
///
512-
/// let firstWord = text.prefix(7)
512+
/// let firstWord = text.prefix(while: { $0 != " " })
513513
/// print(firstWord)
514514
/// // Prints "Buffalo"
515515
///
516-
/// You can retrieve the same slice using other methods, such as finding the
517-
/// terminating index, and the using the string's ranged subscript, or by
518-
/// using the `prefix(upTo:)` method, which takes an index as its parameter.
516+
/// You can retrieve the same slice using the string's ranged subscript, which
517+
/// takes a range expression.
519518
///
520519
/// if let firstSpace = text.index(of: " ") {
521520
/// print(text[..<firstSpace]
522521
/// // Prints "Buffalo"
523-
///
524-
/// print(text.prefix(upTo: firstSpace))
525-
/// // Prints "Buffalo"
526522
/// }
527523
///
528524
/// The retrieved slice of `text` is equivalent in each of these cases.

0 commit comments

Comments
 (0)