Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1669464
  • 博文数量: 1493
  • 博客积分: 38
  • 博客等级: 民兵
  • 技术积分: 5834
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-19 17:28
文章分类

全部博文(1493)

文章存档

2016年(11)

2015年(38)

2014年(137)

2013年(253)

2012年(1054)

2011年(1)

分类:

2012-08-21 08:49:51

/* Strip whitespace from the start and end of STRING.  Return a pointer
   into STRING. */
    char *
stripwhite (string)
    char *string;
{
    register char *s, *t; 

    for (s = string; whitespace (*s); s++)
        ;   

    if (*s == 0)
        return (s);

    t = s + strlen (s) - 1;
    while (t > s && whitespace (*t))
        t--;
    *++t = '\0';

    return s;
}
阅读(150) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~