Mercurial > trustbridge
comparison common/strhelp.c @ 133:c719d3fdbc15
Added functrion to trim white space from string.
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Mon, 24 Mar 2014 15:11:47 +0100 |
parents | 9104b1b2e4da |
children | 5f830969e4a1 |
comparison
equal
deleted
inserted
replaced
132:4691d9e3b1d3 | 133:c719d3fdbc15 |
---|---|
121 if (strncmp(s1, s2, strlen(s2)) == 0) | 121 if (strncmp(s1, s2, strlen(s2)) == 0) |
122 return true; | 122 return true; |
123 else | 123 else |
124 return false; | 124 return false; |
125 } | 125 } |
126 | |
127 void | |
128 str_trim (char **s) | |
129 { | |
130 size_t i; | |
131 while (isspace(**s)) | |
132 (*s)++; | |
133 i = strlen(*s); | |
134 while (isspace((*s)[--i])) | |
135 (*s)[i] = '\0'; | |
136 } |