replace (&str, array_length (str.chars), string, token, replacement);

replace (&str, array_length (str.chars), string, token, replacement, STR_RIGHT);

replace (&str, array_length (str.chars), string, token, replacement, start_position);

replace (&str, array_length (str.chars), string, token, replacement, start_position, STR_RIGHT);