//字符串轉(zhuǎn)變?yōu)閿?shù)組1
NSMutableString
- str=[[
NSMutableString
alloc]initWithFormat:@
"1,1,1,1,1,1"
];
//字符串轉(zhuǎn)變?yōu)閿?shù)組2
NSMutableArray
- array=[
NSMutableArray
arrayWithArray:[str componentsSeparatedByString:@
","
]];
//替換數(shù)組中的某個值
[array replaceObjectAtIndex:4 withObject:@
"2"
];
//把數(shù)組轉(zhuǎn)換成字符串
NSString
*ns=[array componentsJoinedByString:@
","
];