通过UIbutton删除UITextField内容

比如说,在UITextField中有10个字符,我通过编码实现了,点击UIButton可以逐个删除这些字符。不过我需要更进一步的限制:用户只能删除10个字符中后5个字符。这样应该怎么实现?

代码:

-(IBAction)delete:(id)sender{
    if ([display.text length] != 0) {
        display.text = [display.text substringToIndex:[display.text length]-1];
    }
if ([display.text length] > 5) {
    display.text = [display.text substringToIndex:[display.text length]-1];
}