自动换行模糊处理
来源:互联网 发布:centos ruby 版本升级 编辑:程序博客网 时间:2024/05/21 08:58
#import "string.h"const int COUNTS_OF_LINE = 93;void cpytoend(char* str, char* pstart, char* pend){while (pstart != pend + 1){*str = *pstart == '\n'? ' ': *pstart;//对换行符进行特殊处理pstart++;str++;}*str = '\0';}BOOL isEnd(char c){if (c == ' ' || c == ',' || c == '.')//可作为换行的标识字符{return YES;}else {return NO;}}int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];char strContent[2048] = {0};NSString * astring = The Remote Controller is an application that turns your iPad, ""iPhone or iPad touch into a remote control for your IPTV. \n""jk's vision is to enrich people's lives through communication. By leveraging our experience and""expertise in telecom sector,we help bridge the digtal ""digital divide and give people the opportunity to join the information age,regardless og their geographic origin. In order to tackle increasing climate ""challenges, jk has deployed a wide range of green solutions that enable customers to reduce power consumption and carbon emissions, contributing to the ""sustainable develoopment of the social economy and the environment.";strcpy(strContent, [astring UTF8String]); char * pchstart = strContent; char * pend = pchstart; int number = 0; while (*pend != '\0') { if (number < COUNTS_OF_LINE) { if ( *pend == '\n' || *(pend + 1) == '\0') { char tmpstr[100] = {0}; cpytoend(tmpstr, pchstart, pend); NSLog(@"======%s", tmpstr); pchstart = pend + 1; number = 0; } } else { if (isEnd(*pend) ) { char tmpstr[100] = {0}; cpytoend(tmpstr, pchstart, pend); NSLog(@"======%s", tmpstr); pchstart = pend + 1; number = 0; } } number++; pend++; }}
- 自动换行模糊处理
- 表格自动换行处理
- JTable的自动换行处理
- JTable的自动换行处理
- 处理TABLEVIEW的LABEL内容自动换行
- C#自动换行公共类--字符串处理
- DrawText英文自动换行的处理方法
- iOS 图片模糊处理和自动获取图片尺寸
- 自动换行
- 自动换行
- 自动换行
- 自动换行
- 自动换行
- 自动换行
- 自动换行
- 自动换行
- 文本区Textarea数据后台自动换行的处理方法
- 关于处理Excel表中文字不能自动换行问题
- 我的课堂感受
- 不要重复做相同的事。
- android 拖拽图片
- cisco 2950、 3550 端口速率限制实现
- 企业管理软件的发展历程
- 自动换行模糊处理
- MySQL VS SQL Server之用法差别
- 通向MySQL神秘王国的图形化之路
- 20个非常有用的电脑技术
- Javascript URL 转义字符
- 浏览器缓存实现原理
- 标注点5部分成型图
- 常用的电脑技巧大全
- DWR3 学习笔记 - 第一个DWR3程序