How to find the unicode of the subscript alphabet?

Take a look at the wikipedia article Unicode subscripts and superscripts. It looks like these are spread out across different ranges, and not all characters are available. Consolidated for cut-and-pasting purposes, the Unicode standard defines complete sub- and super-scripts for numbers and common mathematical symbols ( ⁰ ¹ ² ³ ⁴ ⁵ ⁶ ⁷ ⁸ … Read more

‘subscript’ is unavailable: cannot subscript String with a CountableClosedRange, see the documentation comment for discussion

If you want to use subscripts on Strings like “palindrome”[1..<3] and “palindrome”[1…3], use these extensions. Swift 4 extension String { subscript (bounds: CountableClosedRange<Int>) -> String { let start = index(startIndex, offsetBy: bounds.lowerBound) let end = index(startIndex, offsetBy: bounds.upperBound) return String(self[start…end]) } subscript (bounds: CountableRange<Int>) -> String { let start = index(startIndex, offsetBy: bounds.lowerBound) let end … Read more

tech