input: Write a function to replace all occurrences of a given string with an alternate string in an input string. If the input string is empty then return the input string as is.
  assert replace_string("Hello World!", "World", "Python")=="Hello Python!"
  assert replace_string("To be or not to be", "be", "code")=="To code or not to code"
  assert replace_string("Example text", "text", "")=="Example "
  assert replace_string("", "any", "thing")==""
  assert replace_string("Substrings everywhere", "sub", "SUP")=="Supstrings everywhere"
output: def replace_string(input_str, old_str, new_str):
      if not input_str:
          return input_str
      return input_str.replace(old_str, new_str)