Function replaceSubstring

Replaces substrings in a given string with specified replacements.

  • Parameters

    • str: string

      The original string.

    • from: string | string[]

      The substring(s) to be replaced. Can be an array or a single string.

    • to: string | string[]

      The replacement(s) for the substrings. Can be an array or a single string.

    Returns string

    • The modified string with the replaced substrings.