stdlib: convert join() into a protocol extension

Part of rdar://22022419

Swift SVN r31186
This commit is contained in:
Dmitri Hrybenko
2015-08-12 21:16:25 +00:00
parent 34f6bd0956
commit d6f04ade75
7 changed files with 84 additions and 109 deletions

View File

@@ -325,17 +325,6 @@ extension String.CharacterView : RangeReplaceableCollectionType {
// Algorithms
extension String.CharacterView {
/// Interpose `self` between every pair of consecutive `elements`,
/// then concatenate the result. For example:
///
/// "-|-".join(["foo", "bar", "baz"]) // "foo-|-bar-|-baz"
@warn_unused_result
public func join<
S : SequenceType where S.Generator.Element == String.CharacterView
>(elements: S) -> String.CharacterView {
return Swift.join(self, elements)
}
/// Access the characters in the given `subRange`.
///
/// - Complexity: O(1) unless bridging from Objective-C requires an