Skip to content

Instantly share code, notes, and snippets.

@osmszk
Last active August 29, 2015 14:05
Show Gist options
  • Save osmszk/e767ea96c82ac200f2c9 to your computer and use it in GitHub Desktop.
Save osmszk/e767ea96c82ac200f2c9 to your computer and use it in GitHub Desktop.
Count text length considering Zenkaku(multibyte character)
//@"あいう":6
//@"abc":3
- (NSInteger)textCountWithString:(NSString *)string
{
return [string lengthOfBytesUsingEncoding:NSShiftJISStringEncoding];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment