Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "string/remove-utf8-bom/docs/types/index.d"

Index

Functions

Functions

Export assignment removeUTF8BOM

  • removeUTF8BOM(str: string): string
  • Removes a UTF-8 byte order mark (BOM) from the beginning of a string.

    Notes

    • A UTF-8 byte order mark (BOM) is the byte sequence 0xEF,0xBB,0xBF.
    • To convert a UTF-8 encoded Buffer to a string, the Buffer must be converted to UTF-16. The BOM thus gets converted to the single 16-bit code point '\ufeff' (UTF-16 BOM).

    Parameters

    • str: string

      input string

    Returns string

    string with BOM removed

    Example

    var str = removeUTF8BOM( '\ufeffbeep' );
    // returns 'beep'