标签:result getc util class aar nss object options min
NSString *signValue = [NSString stringWithFormat:@"%@%@", valueJson, [Utility getCurrentTimes]];
NSMutableString * getSignString = [NSMutableString string];
NSMutableArray * mutaArray = [NSMutableArray array];
for (int i = 0; i < [signValue length]; i ++) {
[mutaArray addObject:[signValue substringWithRange:NSMakeRange(i, 1)]];
}
NSStringCompareOptions comparisonOptions = NSCaseInsensitiveSearch|NSNumericSearch|
NSWidthInsensitiveSearch|NSForcedOrderingSearch;
NSComparator sort = ^(NSString *obj1,NSString *obj2){
NSRange range = NSMakeRange(0,obj1.length);
return [obj1 compare:obj2 options:comparisonOptions range:range];
};
NSArray *resultArray2 = [mutaArray sortedArrayUsingComparator:sort];
for (NSString * oldString in resultArray2) {
[getSignString appendString:oldString];
}
//signValue为输入字符串, getSignString为最后得到字符串
标签:result getc util class aar nss object options min
原文地址:https://www.cnblogs.com/allenwuhen/p/9680476.html