pols-utils - v5.3.11
    Preparing search index...

    Function highlight

    • Replace quotation mark (' or ") with an HTML tag.

      Parameters

      • value: string

        The target string.

      • tag: string = 'b'

        The name of the HTML tag to use for highlighting.

      Returns string

      A new string with the specified tag applied to quoted text.

      console.log(PUtilsString.highlight(\`Hi 'user'!\`)) // 'Hi <b>user</b>!'
      console.log(PUtilsString.highlight(\`Hi "user"!\`)) // 'Hi <b>user</b>!'
      console.log(PUtilsString.highlight(\`Hi 'user"!\`)) // `Hi 'user"!`