<= operator not working as expected
<p>I am new to iOS and am baffled by the behavior of my following code. I want to validate a zip code and throw an alert if the user inputs more that 5 digits. I am using the number keyboard to ensure that I don't get anything but nums. </p>

<p>The alert throws at the 6th digit, which is what I want. If I hit the 'back button' to delete the last digit, on positions 0-3, it behaves just fine and deletes the last digit. If I hit the 'back button' on position 4, the alert throws. What am I doing wrong? How do I delete the 5th digit (postion 4 in the array)? </p>

<p>Thanks</p>

<pre><code>- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
        if ([zipText.text length] &lt;= 4)
        {
            return YES;
        }
        else 
        {
            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Zip Code Limit" message:@"The system only requires a 5 digit zip code." delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:nil, nil];

            [alert show];
            [alert release];
            return NO;
        }
}
</code></pre>
