for (int i=0 ; i<=[secondSplitArrayValue count]; i++)
{
if (![[secondSplitArrayValue objectAtIndex:i] isEqualToString:@"NULL"] ||
![[splitArrayValue objectAtIndex:i] isEqualToString:@"Error"]
{
[secondSplitArrayValue removeObjectAtIndex:i];
}
}
I am trying to remove value of array at particular index where string is NOT EQUAL (!=) to NULL or Error. But in debugging time object is removed where NULL and Error present but I want to remove object where Null and Error not present.
You're probably looking for this I think:
for (int i=0 ; i<=[secondSplitArrayValue count]; i++)
{
if (!([[secondSplitArrayValue objectAtIndex:i] isEqualToString:@"NULL"] ||
[[splitArrayValue objectAtIndex:i] isEqualToString:@"Error"])
{
[secondSplitArrayValue removeObjectAtIndex:i];
}
}
This way you inverse the boolean operation only after you have completed the check for both cases, and the OR operation of both of the resulting checks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With