c去除空格 小写转大写

来源:互联网 发布:unity3d粒子系统爆炸 编辑:程序博客网 时间:2024/06/07 11:11
int isalnum(int c); //字母或数字int isalpha(int c); //英文字母int isascii(int c); //ASCII 码字符(0 到127)int isblank(int c); //空(空白space或制表符tab)int iscntrl(int c); //控制字符(0x00-0x1F或0x7F)int isdigit(int c); //阿拉伯数字0到9int isgraph(int c); //可打印字符(非空格)int islower(int c); //小写英文字母int isprint(int c); //可打印字符(0x20-0x7e 含空格)int ispunct(int c); //标点符号或特殊符号(非空格、非数字和非英文字母)int isspace(int c); //空格字符int isupper(int c); //大写英文字母int isxdigit(int c); //16进制数字
int toupper(int c);int tolower(int c);

isprint

char *str = " hello furong.";char buf[20] = {0};memcpy(buf, str, strlen(str));int i = 0;for(i = 0; i < strlen(str); i++){    if(isprint(*(buf + i)))    {        puts(buf + i);        break;    }   }# ./a.out  hello furong.

isgraph

char *str = " hello furong.";char buf[20] = {0};memcpy(buf, str, strlen(str));int i = 0;for(i = 0; i < strlen(str); i++){    if(isgraph(*(buf + i)))    {        puts(buf + i);        break;    }   }# ./a.out hello furong.
原创粉丝点击