human
how to replace string.
assistant
Here is a Python function to replace string strings

import re

def replace_string(string, old, new):
    """
    Replace all instances of old in string with new.
    """
    return string.replace(old, new)

# Enter the string
string = "rose"

# Enter the old string
old = "dog"

# Enter the new string
new = "submarine"

# Calling the function
print((replace_string(string, old, new)))

#Example Output
# rose

#Remember to inspect code for bugs.