input: Write a function to replace all occurrences of a given string with an alternate string in a provided input string. The function should return the modified string. If the input string is empty, it should return an empty string.
  assert replace_string("Hello World!", "World", "Python")=="Hello Python!"
  assert replace_string("Python is fun, fun is Python", "fun", "awesome")=="Python is awesome, awesome is Python"
  assert replace_string("This is a test", "is", "X")=="ThX X a test"
  assert replace_string("", "anything", "whatever")==""
  assert replace_string("No changes needed", "missing", "replacement")=="No changes needed"
output: def replace_string(input_str, old_str, new_str):
      if not input_str:
          return ""
      return input_str.replace(old_str, new_str)