@@ -81,13 +81,11 @@ extension RangeReplaceableCollection {
8181// MARK: Fixed pattern algorithms
8282
8383extension Collection where Element: Equatable {
84- /// Returns a new collection of the same type by removing initial elements
85- /// that satisfy the given predicate from the start.
86- /// - Parameter predicate: A closure that takes an element of the sequence
87- /// as its argument and returns a Boolean value indicating whether the
88- /// element should be removed from the collection.
84+ /// Returns a new collection of the same type by removing `prefix` from the start
85+ /// of the collection.
86+ /// - Parameter prefix: The collection to remove from this collection.
8987 /// - Returns: A collection containing the elements of the collection that are
90- /// not removed by `predicate `.
88+ /// not removed by `prefix `.
9189 @available ( SwiftStdlib 5 . 7 , * )
9290 public func trimmingPrefix< Prefix: Sequence > (
9391 _ prefix: Prefix
@@ -97,11 +95,8 @@ extension Collection where Element: Equatable {
9795}
9896
9997extension Collection where SubSequence == Self , Element: Equatable {
100- /// Removes the initial elements that satisfy the given predicate from the
101- /// start of the sequence.
102- /// - Parameter predicate: A closure that takes an element of the sequence
103- /// as its argument and returns a Boolean value indicating whether the
104- /// element should be removed from the collection.
98+ /// Removes `prefix` from the start of the collection.
99+ /// - Parameter prefix: The collection to remove from this collection.
105100 @available ( SwiftStdlib 5 . 7 , * )
106101 public mutating func trimPrefix< Prefix: Sequence > (
107102 _ prefix: Prefix
@@ -111,11 +106,8 @@ extension Collection where SubSequence == Self, Element: Equatable {
111106}
112107
113108extension RangeReplaceableCollection where Element: Equatable {
114- /// Removes the initial elements that satisfy the given predicate from the
115- /// start of the sequence.
116- /// - Parameter predicate: A closure that takes an element of the sequence
117- /// as its argument and returns a Boolean value indicating whether the
118- /// element should be removed from the collection.
109+ /// Removes `prefix` from the start of the collection.
110+ /// - Parameter prefix: The collection to remove from this collection.
119111 @available ( SwiftStdlib 5 . 7 , * )
120112 public mutating func trimPrefix< Prefix: Sequence > (
121113 _ prefix: Prefix
@@ -127,11 +119,11 @@ extension RangeReplaceableCollection where Element: Equatable {
127119// MARK: Regex algorithms
128120
129121extension BidirectionalCollection where SubSequence == Substring {
130- /// Returns a new collection of the same type by removing `prefix` from the
131- /// start .
132- /// - Parameter prefix : The collection to remove from this collection.
122+ /// Returns a new collection of the same type by removing the initial elements
123+ /// that matches the given regex .
124+ /// - Parameter regex : The regex to remove from this collection.
133125 /// - Returns: A collection containing the elements that does not match
134- /// `prefix ` from the start.
126+ /// `regex ` from the start.
135127 @_disfavoredOverload
136128 @available ( SwiftStdlib 5 . 7 , * )
137129 public func trimmingPrefix( _ regex: some RegexComponent ) -> SubSequence {
0 commit comments