* add function to replace a sub snippet of a string