jweinst1
2/26/2016 - 6:32 PM

isnumber.swift

struct CharLib {
    //de
    static var numset = Set("0123456789".characters)
    static var letterset = Set("abcdefghijklmnopqrstuvwxyz".characters)
}

class TokenMethods {
    //determines if string is a number
    static func isNumber(input:String) ->Bool {
        let charset = Set(input.characters)
        return charset.isSubsetOf(CharLib.numset)
    }
}