Easy solution with little code.
Make an extension that includes basic subStringing that nearly all other languages have:
extension String { func subString(start: Int, end: Int) -> String { let startIndex = self.index(self.startIndex, offsetBy: start) let endIndex = self.index(startIndex, offsetBy: end) let finalString = self.substring(from: startIndex) return finalString.substring(to: endIndex) } } Simply call this with
someString.subString(start: 0, end: 6)