本文转载至 http://blog.csdn.net/xunyn/article/details/7882087 iosobjective cuser框架通讯 IOS项目中会用到对通讯录的联系人或是会员按姓名为关键字排序,因为NSArray并不直接支持对汉字的排序,这就要通过将汉字转换成拼音完成按A~Z的排序,这看起来是个头疼的问题,因为牵扯到汉字转为拼音,kmyhy给出一个较易实现的方法,获取汉字的首字的首字母,如将“王”变成“W”,完整文章(传送门). 其中他通过pinyinFirstLet…
1.自定义一个比较器,其参数为待排序的属性. 2.将带参数的比较器传入sort(). var data = [    {name: "Bruce", age: 23, id: 16, score: 80},    {name: "Alice", age: 24, id: 12, score: 90},    {name: "David", age: 21, id: 11, score: 70},    {name: "Cindy&quo…
1.自定义一个比较器,其参数为待排序的属性. 2.将带参数的比较器传入sort(). var data = [ {name: "Bruce", age: 23, id: 16, score: 80}, {name: "Alice", age: 24, id: 12, score: 90}, {name: "David", age: 21, id: 11, score: 70}, {name: "Cindy", age: 22,…
方法一: NSArray *sortArray = [arrayM sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) { SDHomeNewTaskModel *model1 = obj1; SDHomeNewTaskModel *model2 = obj2; if ([model1.distance floatValue] > [model2.distance floatValue]) { return NSOrd…
package com.swift; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; public class Zhongwen_Shuzi_Times { public static void main(String[] args) { /* * 有一个字符串,其中包含中文字符.英文字符和数字字符,请统计和打印出各个字符的个数 */ String str="琅琊榜fengqichanglin…
(之前发的这篇博文因为含有敏感关键字,只好重发一遍了) <?php $str = "我们可以在浏览器中看到,当鼠标移到元素上时,元素开始向右移动,开始比较慢,之后则比较快,移开时按原曲线回到原点."; $len = mb_strlen($str); $sta = []; for($i = 0; $i<$len; $i++){ $tmp = mb_substr($str,$i,1); if($tmp != " "){ array_push($sta,$tm…
js中实现中文按字母拼音排序 var Pinyin = (function (){ var Pinyin = function (ops){ this.initialize(ops); }, options = { checkPolyphone: false, charcase: 'default' }; Pinyin.fn = Pinyin.prototype = { init: function (ops){ this.options = extend(options, ops); }, i…
IOS数组.字典.NSNumber 新写法—— @[].@{}   //标准写法 NSNumber * number = [NSNumber numberWithInt:]; NSArray * array = [NSArray arrayWithObjects:@"one", @"two", nil]; NSDictionary * dict = [NSDictionary dictionaryWithObjectsAndKeys:@"value1&qu…
相关链接: ios数组基本用法和排序 NSArray 排序汇总 iOS 数组排序方法 IOS-筛选数组内的元素 关于EnumerateObjectsUsingBlock和for-in之间的较量 [iOS开发技术]NSPredicate谓词的用法 数组过滤…
select zjm from xskh where guid_yw='e6ee44f3-98ab-4446-bd9b-db2e525d3b24' and zjm not like  '%[ABCDEFGHIJKLMNOPQRSTUVWXYZ]%'--不包含a-z字母 select * from xskh where (ISNUMERIC(aname_long)=1 or isnull(aname_long,'')='')--ISNUMERIC 函数是判断该字段的值是否为数字是=1不是=0 ,但…