code: function replaceAll(str, find, replace, caseInsensitive)
  {
      if (find === null || find === (void 0))
      {
          return str;
      }
      if (replace === null || replace === (void 0))
      {
          replace = '';
      }
      find = String(find);
      replace = String(replace).replace(/\$/g, '$$$$'); //$ has special meaning in RHS of regexes, escape with $$
      var findRegex = new RegExp(find.replace(/([\\\^\$\{\}\[\]\(\)\.\*\+\?\|])/g, '\\$&'), caseInsensitive ? 'gi' : 'g');
      return str.replace(findRegex, replace);
  }
docs: /*
  Replaces all instances of `find` in `str` with `replace`
  Optionally case-insensitive.  Uses regex hax to make this all work