代码片段引用
protocol Sequence {
// ...
/// 从头开始遍历元素,忽略当`predicate`返回`true`时的元素,返回剩下的元素
func drop(while predicate: (Self.Iterator.Element) throws -> Bool) rethrows -> Self.SubSequence
/// 从头开始遍历元素,返回`predicate`为`false`之前的所有元素,忽略剩下的元素
func prefix(while predicate: (Self.Iterator.Element) throws -> Bool) rethrows -> Self.SubSequence
}