Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "assert/has-utf16-surrogate-pair-at/docs/types/index.d"

Index

Functions

Export assignment hasUTF16SurrogatePairAt

  • hasUTF16SurrogatePairAt(str: string, pos: number): boolean
  • Tests if a position in a string marks the start of a UTF-16 surrogate pair.

    throws

    first argument must be a string

    throws

    second argument must be a nonnegative integer

    throws

    position must be a valid index in string

    Parameters

    • str: string

      input string

    • pos: number

      position

    Returns boolean

    boolean indicating if a position in a string marks the start of a UTF-16 surrogate pair

    Example

    var bool = hasUTF16SurrogatePairAt( '🌷', 0 );
    // returns true

    Example

    var bool = hasUTF16SurrogatePairAt( '🌷', 1 );
    // returns false