```
NSRange rangetxt={0,(index-1)};
NSString *tempStr= textBox.text;
NSString *tempTextBox=[tempStr substringWithRange:rangetxt];

```

Hi Everyone,

I want to know why my pasted code isn't working properly, when the compiler passes `substringWithRange` It hung up and do not assign any value to `tempTextBox`, Secondly I've tried the NSString function `substringToIndex` as well yet its not working too, My objective is to skip the last character while copying `tempStr` to `tempTextBox`.

Regards
MGD