There is an object:
NSTextField *outText = "Текст";
How to check the second line element as it was in C ++:
if(outText[1] == 'е'){ ...
There is an object:
NSTextField *outText = "Текст";
How to check the second line element as it was in C ++:
if(outText[1] == 'е'){ ...
You can get to the second character in the following way (I write everything in one line, although I need to break it for readability and to check that there really is a second character in the line):
if ([[[outText stringValue] substringWithRange:NSMakeRange(1,1)] isEqualToString:@"e"]) { // ... }
I did not check it myself, but it should work.
characterAtIndex
myself and wrote a quick reply. Of course, characterAtIndex
, in short. That's right. - Stanislav PankevichSource: https://ru.stackoverflow.com/questions/264879/
All Articles