ios - How can I remove the parentheses from the last item in NSArray -
i creating array .txt file looks this:
bears;wins;24;losses;15 lions;wins;34;losses;10
etc.
when array each line with:
nsarray *myarray = [content componentsseparatedbystring:@"\n"];
i array this:
("bears;wins;24;losses;15 ", "lions;wins;34;losses;10 ")
when parse out semicolon this:
(bears, wins, 24, losses, "15 " ), ( lions, wins, 34, losses, "10 ")
the problem when want move objects make look/print this:
lions,34,10,wins,losses
the output instead coming out this:
lions,34 ,10,wins,losses
how can fix keep on 1 line?
the problem when separating line with:
nsarray *arr = [content componentsseparatedbystring:@"\n"];
i fixed separating line with:
nsarray *arr = [content componentsseparatedbystring:@"\r\n"];
Comments
Post a Comment