import Foundation /* 枚举 语法结构 enum 类型 { case 值 } */ //定义一个枚举 写法1 enum LiuShiQun { case Name case Age case Sex case Add case Sub case Mul case Div } //定义一个枚举 写法2 enum LiuShiQun_1 { case Add,Sub case Mul case Div } //定义一个枚举变量 写法1 let enum_Name: LiuShiQu…
swift 中的运算符 import Foundation //字符类型 var char: Character = "a" char="b" println(char) var str:String str="abcceadfasdfl;jk\0dfaaaa 0001496" println(str) //查看长度 countElements 返回的元素个数 println(countElements(str)) var str1="…
import Foundation ; i<=; i++ { println(i) } let str1="adl;fjasdfl;ouewrouqwperuadf" for c in str1 { switch c { case "a","f","o": println(c) default: var t="" } } switch x { ... : println("个位数"…