diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-06-30 08:18:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-06-30 08:18:03 +0300 |
commit | d59721e47aba4c9db96cfe5b10c63969ff361897 (patch) | |
tree | 9158cfdeb118e3b09f19ddc087c71c9ddcfabace /source/blender/blenlib/intern/string.c | |
parent | d17cb3f75f2c1e3b0d729da24f5fd1793b823760 (diff) |
Cleanup: move BLI_char_switch into BLI_string
Diffstat (limited to 'source/blender/blenlib/intern/string.c')
-rw-r--r-- | source/blender/blenlib/intern/string.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index 11c1f93ca19..28cc5eb2f9f 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -477,6 +477,23 @@ char *BLI_str_replaceN(const char *__restrict str, const char *__restrict substr } /** + * In-place replace every \a src to \a dst in \a str. + * + * \param str: The string to operate on. + * \param src: The character to replace. + * \param dst: The character to replace with. + */ +void BLI_str_replace_char(char *str, char src, char dst) +{ + while (*str) { + if (*str == src) { + *str = dst; + } + str++; + } +} + +/** * Compare two strings without regard to case. * * \retval True if the strings are equal, false otherwise. |