计算文字的个数
2016-07-22 10:49
253 查看
#pragma mark - 计算文字的个数
//- (BOOL)isChinesecharacter:(NSString *)string
//{
// if (string.length == 0)
// {
// return NO;
// }
// unichar c = [string characterAtIndex:0];
// if (c >=0x4E00 && c <=0x9FA5)
// {
// return YES;//汉字
// }
// else
// {
// return NO;//英文
// }
//}
////计算汉字的个数
//- (NSInteger)chineseCountOfString:(NSString *)string
//{
// int ChineseCount = 0;
// if (string.length == 0)
// {
// return 0;
// }
// for (int i = 0; i<string.length; i++)
// {
// unichar c = [string characterAtIndex:i];
// if (c >=0x4E00 && c <=0x9FA5)
// {
// ChineseCount++;//汉字
// }
// }
// return ChineseCount;
//}
////计算字母的个数
//- (NSInteger)characterCountOfString:(NSString *)string
//{
// int characterCount = 0;
// if (string.length == 0)
// {
// return 0;
// }
// for (int i = 0; i<string.length; i++)
// {
// unichar c = [string characterAtIndex:i];
// if (c >=0x4E00 && c <=0x9FA5)
// {
// }
// else
// {
// characterCount++;//英文
// }
// }
// return characterCount;
//}
//- (BOOL)isChinesecharacter:(NSString *)string
//{
// if (string.length == 0)
// {
// return NO;
// }
// unichar c = [string characterAtIndex:0];
// if (c >=0x4E00 && c <=0x9FA5)
// {
// return YES;//汉字
// }
// else
// {
// return NO;//英文
// }
//}
////计算汉字的个数
//- (NSInteger)chineseCountOfString:(NSString *)string
//{
// int ChineseCount = 0;
// if (string.length == 0)
// {
// return 0;
// }
// for (int i = 0; i<string.length; i++)
// {
// unichar c = [string characterAtIndex:i];
// if (c >=0x4E00 && c <=0x9FA5)
// {
// ChineseCount++;//汉字
// }
// }
// return ChineseCount;
//}
////计算字母的个数
//- (NSInteger)characterCountOfString:(NSString *)string
//{
// int characterCount = 0;
// if (string.length == 0)
// {
// return 0;
// }
// for (int i = 0; i<string.length; i++)
// {
// unichar c = [string characterAtIndex:i];
// if (c >=0x4E00 && c <=0x9FA5)
// {
// }
// else
// {
// characterCount++;//英文
// }
// }
// return characterCount;
//}
相关文章推荐
- 【示例】Hibernate中读取txt的文件内容并插入到数据库
- Java 复制字符串到系统剪贴板(未测试)
- <a href=”#”>
- MySQL存储过程和存储函数
- Tessellation Shader(细分曲面着色器)
- 几句话实现导航栏透明渐变(iOS)
- MFC网络编程笔记
- SpringMVC Controller 返回值的可选类型
- Objective-C学习之判断字符串是qq,银行卡,手机号等等公用的方法
- UItableVIew 的隐藏属性(隐藏换行线/取消cell选择时颜色选中)
- [172] Factorial Trailing Zeroes
- STL vector用法介绍
- java获取本地操作系统进程列表(未测试)
- scala : Case clauses expected
- java 8种基本数据类型的默认值及所占字节数
- HDU1056 HangOver
- 按钮的各种操作
- Java获得jvm占用的内存和系统的可用内存信息(未测试)
- iOS学习之分享学习iOS的资源网站
- JAVA设计模式--策略模式