NSString 取子串,拼字符串,分割

取得string长度 [string length];component

 

取子串: [string substringFromIndex:index];   //从index位取到字符串尾orm

[string substringWithRange:NSMakeRange(location,substringLength)]; //location代表起始位置,substringLength代表取长度字符串

 

拼接字符串: [NSString stringWithFormat:@"%@%@%@",string1,string2,string3];string

 

分割字符串it

NSArray *list = [string componentsSeparatedByString:@"/"];  //将字符串用/分割,存入list中。io