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, return the input string as is.
  assert replace_string("Hello World!", "World", "Python")=="Hello Python!"
  assert replace_string("Goodbye World!", "World", "Universe")=="Goodbye Universe!"
  assert replace_string("Hello World!", "o", "x")=="Hellx Wxrld!"
  assert replace_string("", "World", "Python")==""
  assert replace_string("Hello World!", "", "Python")=="Hello World!"
output: def replace_string(input_str, old_str, new_str):
      if not input_str:
          return input_str
      if not old_str:
          return input_str
      return input_str.replace(old_str, new_str)