Added replaceMacroInString()