Write a Python program to replace all the occurences of a substring in a string with a new substring.
String: This is a string
Old substring: is
New substring: was
new_string = string.replace('is', 'was')