// Str = @"PEK_LHR"
NSRange range = [trafficeStr rangeOfString:@"_" options:NSBackwardsSearch];
from = [trafficeStr substringToIndex:range.location];
to = [trafficeStr substringFromIndex:range.location + 1];
本文共 207 字,大约阅读时间需要 1 分钟。
// Str = @"PEK_LHR"
NSRange range = [trafficeStr rangeOfString:@"_" options:NSBackwardsSearch];
from = [trafficeStr substringToIndex:range.location];
to = [trafficeStr substringFromIndex:range.location + 1];
转载地址:http://wgdko.baihongyu.com/