Extension Array where Element == Range<String.Index> { // <== how to generalize to any kind of Range<X>, not just <String.Index>?

There's not actually a better way in today's Swift, but @Alejandro has been working to improve that! Hopefully the core team will be ready for "Parameterized Extensions" soon.

6 Likes