0

I tried to map the following ClosedRange<String> type:

"a"..."z".map({ $0.uppercased() }) 

Error:

note: candidate requires that 'String' conform to 'Strideable' (requirement specified > as '_' : 'Strideable')
extension ClosedRange : Collection, BidirectionalCollection, RandomAccessCollection > where Bound : Strideable, Bound.Stride : SignedInteger {

However, I am able to do it when the elements of the type are Int:

(1...10).map({ $0 + 1 })

How can I solve this issue when the elements are of String type ?

F. Zer
  • 1,081
  • 7
  • 9

0 Answers0