diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-02-06 14:17:43 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-02-06 14:17:43 +0000 |
commit | 210bbf027268137a23e8f10181225ffb5bb97cdc (patch) | |
tree | b429c0e4394cf420847476fcb2ca1db70943689d /src/libutil/str_util.h | |
parent | d525194397181456bba6edea4680a10403c3415c (diff) | |
download | rspamd-210bbf027268137a23e8f10181225ffb5bb97cdc.tar.gz rspamd-210bbf027268137a23e8f10181225ffb5bb97cdc.zip |
[Minor] Add function to strip characters
Diffstat (limited to 'src/libutil/str_util.h')
-rw-r--r-- | src/libutil/str_util.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libutil/str_util.h b/src/libutil/str_util.h index 5e3d7a201..72e0ab56f 100644 --- a/src/libutil/str_util.h +++ b/src/libutil/str_util.h @@ -454,6 +454,14 @@ gchar * rspamd_str_make_utf_valid (const gchar *src, gsize slen, gsize *dstlen); */ gsize rspamd_gstring_strip (GString *s, const gchar *strip_chars); +/** + * Strips characters in `strip_chars` from start and end of the sized string + * @param s + * @param strip_chars + */ +const gchar* rspamd_string_len_strip (const gchar *in, + gsize *len, const gchar *strip_chars); + #define IS_ZERO_WIDTH_SPACE(uc) ((uc) == 0x200B || \ (uc) == 0x200C || \ (uc) == 0x200D || \ |