Function getCHSLength

  • Get the length of the text, Chinese counts as 2 bytes

    Parameters

    • str: string

      string

    Returns number

    • length
    getCHSLength('测试')
    // 2

    1.0.1