Library API
    Preparing search index...

    Function split

    • Splits a number or string by a delimiter and parses the chunks.

      Type Parameters

      • T extends number

      Parameters

      • nbr: T

        The value to split

      • Optionalchr: string

        The delimiter character (default: '.')

      • Optionalzero: boolean

        Whether to strip leading zeros during numeric conversion (default: true)

      Returns number[]

      An array of parsed numeric or string chunks

      split('12.34'); // [12, 34]
      
    • Splits a number or string by a delimiter and parses the chunks.

      Type Parameters

      • T extends string

      Parameters

      • nbr: T

        The value to split

      • Optionalchr: string

        The delimiter character (default: '.')

      • Optionalzero: boolean

        Whether to strip leading zeros during numeric conversion (default: true)

      Returns (string | number)[]

      An array of parsed numeric or string chunks

      split('12.34'); // [12, 34]