diff --git a/SwiftShell/General/Collection.swift b/SwiftShell/General/Collection.swift index 373eb8a..82d6d05 100644 --- a/SwiftShell/General/Collection.swift +++ b/SwiftShell/General/Collection.swift @@ -5,6 +5,15 @@ * */ +extension CollectionType where Generator.Element: Equatable { + + public func splitOnce (separator: Generator.Element) -> (head: SubSequence, tail: SubSequence?) { + guard let nextindex = indexOf(separator) else { return (self[startIndex..: GeneratorType, LazySequenceType { @@ -26,14 +35,6 @@ public struct LazySplitSequence (head: SubSequence, tail: SubSequence?) { - guard let nextindex = indexOf(separator) else { return (self[startIndex..