Last active
August 29, 2015 14:05
-
-
Save osmszk/e767ea96c82ac200f2c9 to your computer and use it in GitHub Desktop.
Count text length considering Zenkaku(multibyte character)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@"あいう":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