Swift字符串和基本数据类型之间转换

基本数据类型 转 字符串
            let string = String(number);

        let string = UIDevice.currentDevice().systemVersion;
        
        _ = ( string as NSString ).doubleValue;
        
        _ = ( string as NSString ).floatValue;
        
        _ = ( string as NSString ).intValue;
        
        _ = ( string as NSString ).integerValue;
        
        _ = ( string as NSString ).boolValue;
        
        //Int 64
        _ = ( string as NSString ).longLongValue;

Swift字符串和基本数据类型之间转换_第1张图片

你可能感兴趣的:(Swift字符串和基本数据类型之间转换)