Add a new function of string replacement as well as its test.