Function safeReplaceString

  • Replace a string in a text, optionally prepending, appending, replacing all occurrences, and/or calling a callback if the string is not found

    Parameters

    • source: string

      The source text

    • str: string

      The string to replace

    • newStr: string

      The replacement string

    • __namedParameters: {
          append: undefined | boolean;
          notFoundCallback: undefined | (() => void);
          prepend: undefined | boolean;
          replaceAll: undefined | boolean;
      } = {}
      • append: undefined | boolean
      • notFoundCallback: undefined | (() => void)
      • prepend: undefined | boolean
      • replaceAll: undefined | boolean

    Returns string

Generated using TypeDoc