开发者

I have a lib ".a" file, where it contents some value,I am able to read the contents

I have a lib ".a" file, where it contents some value. I am able to read the contents.But I want replace the space with the Comma(,) and remove the first value in it.

For Example if my .a file Contents the following data,

1 2 3

4 5 6

I want the Output in the following way,

2,3

5,6

So i want to remove th开发者_Python百科e first value from each string and want to replace the Space between the second and third values with a Comma(,).How can I do this.


It's may help you!

NSString *str=@"1 2 3";
NSArray *split = [str componentsSeparatedByString:@" "];
NSString *replacevalue=@" ";
for(int i=1;i<[split count];i++)
   {
     if([replacevalue isEqualToString:@" "])
        replacevalue=[NSString stringWithFormat:@"%@",[split objectAtIndex:i]];
     else
        replacevalue=[NSString stringWithFormat:@"%@,%@",replacevalue,[split objectAtIndex:i]];
   }

NSLog(@"%@",replacevalue);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜