Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

get character at specifiic location swift

extension String {
    func characterAtIndex(index: Int) -> Character? {
        var cur = 0
        for char in self {
            if cur == index {
                return char
            }
            cur++
        }
        return nil
    }
}

myString.characterAtIndex(0)!
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #character #specifiic #location #swift
ADD COMMENT
Topic
Name
7+5 =