I have encountered a really odd behavior:
NSLog(@"substring: '%@'\t- length: %d",substring,substring.length);
returns
substring: '' - length: 1
The substring variable is a NSString object.
Can someone please explain what is going on…
EDIT :: SOLVED
As Amy answered:
It’s printing an invisible character.:
ZERO WIDTH JOINER Unicode: U+200D, UTF-8: E2 80 8D
if ([substring isEqualToString:@"\u200d"]) {
NSLog(@"It is a ZERO WIDTH JOINER...");
}
And thanks to Phillip for the tip.
It’s printing an invisible character.:
ZERO WIDTH JOINER
Unicode: U+200D, UTF-8: E2 80 8D