どうも、ちょげ(@chogetarou)です。
文字列(string)の特定の範囲を削除する方法を紹介します。
方法

文字列(string)の特定の範囲を削除するには、removeSubrange()を使います。
まず、削除するString.Indexの範囲を用意します。
そして、split()の引数「separator」にカンマの文字列を指定します。
//text=対象の文字列, start=文字列の最初の位置, end=文字列の最後の位置
let rmRange = start..<end //削除する範囲はString.Indexで指定
text.removeSubrange(rmRange)
上記のremoveSubrange()は、呼び出した文字列の指定した範囲を削除します。

Understanding the removeRange(_:) documentation
To remove a substring at a specified range, use the removeRange(_:) method: 1 let range = advance(welcome.endIndex, -6)..<welcome.endIndex 2 welcome.remov...

How does String.Index work in Swift
I've been updating some of my old code and answers with Swift 3 but when I got to Swift Strings and Indexing it has been a pain to understand things. Specific...
使用例
import Foundation
var text = "Hello,World"
//インデックス0から6までの範囲を削除
let rmRange = text.startIndex..<text.index(text.startIndex, offsetBy: 6)
text.removeSubrange(rmRange)
print(text)
出力:
World
コメント