1
1
mirror of https://github.com/theoludwig/libcproject.git synced 2025-05-21 23:21:15 +02:00

feat: support giving a custom character for string_trim, string_trim_start, string_trim_end

BREAKING CHANGE: Functions signatures changed.
If you want to preserve the same behavior, you should pass explictly the space character to trim:
Example: `string_trim(" Hello ")` => `string_trim(" Hello ", ' ')`
This commit is contained in:
2023-08-05 14:19:44 +02:00
parent 316dfa10e7
commit 06b34b115b
3 changed files with 17 additions and 17 deletions

View File

@ -45,28 +45,28 @@ string_t string_to_lowercase(string_t string_value);
string_t string_replace(string_t string_value, char search, char replace);
/**
* @brief Removes all whitespace from the start of a string.
* @brief Removes all `character` from the start of a string.
*
* @param string_value
* @since v1.0.0
*/
string_t string_trim_start(string_t string_value);
string_t string_trim_start(string_t string_value, char character);
/**
* @brief Removes all whitespace from the end of a string.
* @brief Removes all `character` from the end of a string.
*
* @param string_value
* @since v1.0.0
*/
string_t string_trim_end(string_t string_value);
string_t string_trim_end(string_t string_value, char character);
/**
* @brief Removes all whitespace from the start and end of a string.
* @brief Removes all `character` from the start and end of a string.
*
* @param string_value
* @since v1.0.0
*/
string_t string_trim(string_t string_value);
string_t string_trim(string_t string_value, char character);
/**
* @brief Return the copy of a string.