遍历字符串应该取出字符而非字串, 3楼方法有误.
正确方法为:
正确方法为:
1
2
3
4
5
6
|
NSString
*mytimestr=@
"丑巳午未申"
;
size_t length = [mytimestr length];
for
(size_t i=0; i < length; i++) {
unichar c = [mytimestr characterAtIndex:i];
NSLog
(@
"%C"
, c);
}
|