Edited searchAndReplaceArgumentsInString()