Add mpas_string_replace to replace characters in a given string.
A function to replace characters in a string with another character has been added to the mpas_string_utils module, along with tests in mpas_test_core. The function searches for a character (charToReplace) inside of an input string, and replaces any instances of that character with another character (targetCharacter). Strings are trimmed before characters are replaced to avoid potential issues with trailing whitespace when replacing spaces.
Tests include consecutive characters, whitespace characters, and attempting to replace a character that does not appear in the input string.
Add mpas_string_replace to replace characters in a given string.
A function to replace characters in a string with another character has been added to the mpas_string_utils module, along with tests in mpas_test_core. The function searches for a character (charToReplace) inside of an input string, and replaces any instances of that character with another character (targetCharacter). Strings are trimmed before characters are replaced to avoid potential issues with trailing whitespace when replacing spaces.
Tests include consecutive characters, whitespace characters, and attempting to replace a character that does not appear in the input string.