//字符串分割/前
+(NSString*)string1:(NSString*)str
{
NSRange range = [str rangeOfString:@"||"];
NSString *subStr = [str substringToIndex:range.location];
// NSLog(@"分割前===%@",subStr);
return subStr;
}
//字符串分割/后
+(NSString*)string2:(NSString*)str
{
NSRange range = [str rangeOfString:@"||"];
// /之后的range
range.location+= range.length;
range.length= [str length] - range.location;
NSString*subStr = [str substringWithRange:range];
// NSLog(@"分割后===%@",subStr);
return subStr;
}
网友评论