objcio / functional-swift

Issue repository for the Functional Swift book
http://www.objc.io/books/fpinswift
927 stars 133 forks source link

Appendix: refactor String.characters #91

Closed ole closed 9 years ago

ole commented 9 years ago

The String.characters property can be written shorter:

extension String {
    var characters: [Character] {
        return Array(self)
    }
}

screen shot 2015-05-03 at 20 27 11

chriseidhof commented 9 years ago

Thanks!