cstring · Section 3
cstring_trim
NAME
cstring_trim - strip leading and trailing whitespace in-place
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cstring.h> void cstring_trim(cstr s);
DESCRIPTION
This function removes all leading and trailing white space from the string, in place. White space means the six ASCII bytes space, '\t', '\n', '\v', '\f' and '\r', in every locale, because the function doesn't ask the locale the way isspace() does. No other byte counts as white space, so a byte above 0x7F, such as a no-break space or a piece of a UTF-8 sequence, is never removed and a UTF-8 string stays valid. White space inside the string is kept.
PARAMETERS
s String to change
NOTES
A string that holds nothing but white space becomes empty Asserts if s is NULL