tanerijun / count-chinese

Count the number of Chinese (Mandarin) character in a string.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Count Chinese

npm

Count the number of Chinese (Mandarin) character in a string.

  • Work for both simplified and traditional Chinese.
  • Doesn't count everything else other than Chinese character (space, number, symbol, etc. are all ignored)

Install

npm install count-chinese

Usage

const countChinese = require('count-chinese');
countChinese('Hi!,我是台灣人。') // count = 5

About

Count the number of Chinese (Mandarin) character in a string.

License:MIT License


Languages

Language:JavaScript 100.0%