Dictionary排序
1 | let oldDic:[Int:String] = [ |
数组
基本遍历
1 | for element in list { |
获取index和对应的项
1 | for (index, element) in list.enumerate() { |
二分法查找数字数组中某数字的下标
1 | //二分查找方法 |
String转CChar数组
1 | let charArr = "goodday".cStringUsingEncoding(NSUTF8StringEncoding)!; |
1 | let oldDic:[Int:String] = [ |
基本遍历
1 | for element in list { |
获取index和对应的项
1 | for (index, element) in list.enumerate() { |
1 | //二分查找方法 |
1 | let charArr = "goodday".cStringUsingEncoding(NSUTF8StringEncoding)!; |