trim

来源:互联网 发布:kof98um出招优化 编辑:程序博客网 时间:2024/05/22 14:43
int trim (char s[]){    int n;    for (n = strlen(s) - 1; n >= 0; --n)        if (s[n] != ' ' && s[n] != '\t'  && s[n] != '\n')            break;    s[n + 1] = '\0';    return n;    // return the length}

0 0
原创粉丝点击