moved function from test_get_str to charcell-utils