Logo Search packages:      
Sourcecode: waimea version File versions  Download package

strtrim ( char *  s  ) 

Trims a string.

Removes leading and trailing spaces, tabs and newlines.

Parameters:
s String we want to trim
Returns:
Trimmed string

Definition at line 2865 of file Resources.cc.

                       {
    for (; *s != '\0' && *s == ' ' || *s == '\t' || *s == '\n'; s++);
    if (*s == '\0') return s;
    while (s[strlen(s) - 1] == ' ' ||
           s[strlen(s) - 1] == '\t' ||
           s[strlen(s) - 1] == '\n')
        s[strlen(s) - 1] = '\0';
    return s;
}


Generated by  Doxygen 1.6.0   Back to index