added new function addSlashes, which adds slashes to selected elements within a string to prepare for the being used in a regex for string replace