Replace duplicate strings with (already existing) constant.