SS8_STRIP(3)                     Ssstr Manual                     SS8_STRIP(3)



NAME
       ss8_strip,  ss8_strip_cstr,  ss8_strip_bytes, ss8_strip_ch, ss8_lstrip,
       ss8_lstrip_cstr,    ss8_lstrip_bytes,    ss8_lstrip_ch,     ss8_rstrip,
       ss8_rstrip_cstr, ss8_rstrip_bytes, ss8_rstrip_ch - remove certain char‐
       acters from the ends of an ssstr byte string

SYNOPSIS
       #include <ss8str.h>

       ss8str *ss8_strip(ss8str *restrict str,
                         ss8str const *restrict chars);
       ss8str *ss8_strip_cstr(ss8str *restrict str,
                         char const *restrict chars);
       ss8str *ss8_strip_bytes(ss8str *restrict str,
                         char const *restrict chars, size_t count);
       ss8str *ss8_strip_ch(ss8str *str, char ch);

       ss8str *ss8_lstrip(ss8str *restrict str,
                         ss8str const *restrict chars);
       ss8str *ss8_lstrip_cstr(ss8str *restrict str,
                         char const *restrict chars);
       ss8str *ss8_lstrip_bytes(ss8str *restrict str,
                         char const *restrict chars, size_t count);
       ss8str *ss8_lstrip_ch(ss8str *str, char ch);

       ss8str *ss8_rstrip(ss8str *restrict str,
                         ss8str const *restrict chars);
       ss8str *ss8_rstrip_cstr(ss8str *restrict str,
                         char const *restrict chars);
       ss8str *ss8_rstrip_bytes(ss8str *restrict str,
                         char const *restrict chars, size_t count);
       ss8str *ss8_rstrip_ch(ss8str *str, char ch);

DESCRIPTION
       ss8_strip() removes the prefix and suffix of the ss8str at str consist‐
       ing of bytes that appear in the ss8str at chars.  Behavior is undefined
       unless str and chars point to valid and distinct ss8str objects.

       ss8_strip_cstr() removes the prefix and suffix of  the  ss8str  at  str
       consisting  of  bytes  that  appear  in the null-terminated byte string
       chars.  Behavior is undefined unless str points to a valid  ss8str  ob‐
       ject and chars is a null-terminated byte string.

       ss8_strip_bytes()  removes  the  prefix and suffix of the ss8str at str
       consisting of bytes that appear in the byte string of length count  lo‐
       cated  at  chars.   Behavior  is undefined unless str points to a valid
       ss8str object and chars points to an array of at least count bytes.

       ss8_strip_ch() removes the prefix and suffix of the ss8str at str  con‐
       sisting  of any number of copies of the byte ch.  Behavior is undefined
       unless str points to a valid ss8str object.

       ss8_lstrip(),      ss8_lstrip_cstr(),      ss8_lstrip_bytes(),      and
       ss8_lstrip_ch()  are  like the corresponding functions without the l in
       the name, except that they only remove the prefix consisting  of  chars
       or ch.

       ss8_rstrip(),      ss8_rstrip_cstr(),      ss8_rstrip_bytes(),      and
       ss8_rstrip_ch() are like the corresponding functions without the  r  in
       the  name,  except that they only remove the suffix consisting of chars
       or ch.

RETURN VALUE
       All 12 functions return str.

SEE ALSO
       ss8_find_first_of(3), ssstr(7)



SSSTR                             2023-12-30                      SS8_STRIP(3)