helper function replaceAllOccurrences(inputString, oldStr, newStr)