Introduced replace_str1 function

replace_str1 is a variant of replace_str that replaces only single
substring