Splitting a Collection by another Collection

  • split(separator: CharacterSet) cannot be in the Standard Library because it requires the presence of CharacterSet, which only exists at the Foundation level.
  • String.split(separator: T) -> [Substring] where T: StringProtocol would be a valid addition to the Standard Library, though it would likely be better generalized for Collection instead. A much more filled‐out pitch exists here:
3 Likes