updated and added a unittest for string_replace