From 9814032f6c264102b22fcbfe5a51e230fe6037d1 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Thu, 4 Aug 2022 11:52:02 -0300 Subject: misc: Add `remove_trailing_whitespace()` This function removes any whitespace found at the end of the supplied string. This can be useful when you have a string with whitespace throughout it, but only want the whitespace at the end removed. --- misc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'misc.h') diff --git a/misc.h b/misc.h index eb839de..338c546 100644 --- a/misc.h +++ b/misc.h @@ -5,6 +5,7 @@ extern char *read_file(const char *filename, long *size); extern char *find_delm(char *str, const char *delm, int skip_delm); +extern char *remove_trailing_whitespace(char *str); extern char *get_str_delm_range(char *str, const char *start_delm, const char *end_delm, char **rhs); extern char *get_line(char **str); extern char *make_str(const char *str); -- cgit v1.2.3-13-gbd6f