strtrim 함수
개발/프로그래밍2008. 6. 30. 21:34
728x90
/* * strrtrim.c -- remove trailing whitespace from a string * * Part of publib. See man page for more information * "@(#)publib-strutil:strrtrim.c,v 1.1.1.1 1994/02/03 17:25:30 liw Exp" */ #include#include #include char *strrtrim(char *s) { char *t; assert(s != NULL); t = strchr(s, '\0'); while (t > s && isspace(t[-1])) --t; *t = '\0'; return s; }
728x90
댓글 영역