function: lx_chompf()
USAGE:
char lx_chompf(lx_s *s, char *cstr)
Remove any initial characters located in cstr from string buffer
s.
lx_chompf() overwrites the initial memory space used by s.
PROPERTIES |
return value |
0 on success (1 on out-of-memory error) |
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_chomp_ws -- remove all whitespace from the end of a string buffer
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);
return lx_chompf (s, '\t '); /* remove any initial spaces or tabs */
}