Swift: use native Ranges to extract substrings