我有一个字符串,我试图获取前 2 个字符和字符串的其余部分。这就是我尝试这样做的方式:
NSString *textAll = [arrayOfMessages objectAtIndex:indexPath.row];
NSString *textMessage = [textAll substringFromIndex:2];
NSString *textType = [textAll substringToIndex:1];
textAll 具有这种形式:HE消息本身.....
textType 应该返回'HE' textMessage 应该返回'消息本身.....' Textmessage 现在给了我消息,但我似乎无法获得 textType...