function: lx_chomp_ws()
USAGE:
void lx_chomp_ws(lx_s *s)
Remove all ending whitespace characters from string buffer s.
Whitespace characters include spaces (' '), tabs ('\t'),
newlines ('\n'), and carriage returns ('\r').
This is done by modifying s->len. lx_chomp_ws() does not
deallocate or overwrite any memory used by s.
PROPERTIES |
return value |
void |
allocation ensured |
n/a |
previous allocation required |
yes |
SEE ALSO:
- func_lx_chop -- remove the last n characters from a string buffer
- func_lx_chomp -- remove all specified ending characters from a string buffer
- func_lx_chompf -- remove all specified beginning characters
EXAMPLE:
char get_line (gd, s, match)
lx_gd *gd;
lx_s *s;
char *match;
{
if (lx_getln(s, gd, match, 4096)) _exit (1);
lx_chomp_ws (s); /* remove ending whitespace */
return 0;
}