substring (1) 썸네일형 리스트형 String Extension 문자열 자르기1 extension String { func substring(from: Int, to: Int) -> String { guard count > from, from >= 0, to >= from else { return "" } let startIndex = index(self.startIndex, offsetBy: from) let endIndex = index(self.startIndex, offsetBy: to + 1) return String(self[startIndex.. Character { return self[self.index(self.startIndex, offsetBy: index)] } subscript(_ range: Range) -> String { let from.. 이전 1 다음