我正在做升序字符串排序。目前,“Route101”将排在“Route11”之前,因为 10 在 11 之前。但是,由于 11 小于 101,我希望“Route11”在“Route101”之前。
我知道在 iPhone 中,它有类似的东西,基本上是自然排序:
NSSortDescriptor *cityCodeDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name"
ascending:YES selector:@selector(localizedStandardCompare:)];
Android或Java中有类似的东西。
谢谢。