We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/** * Get chinese first spell letter * * @params {String} c: chinese * @return {String} letter * function getChineseFirstSpellLetter(c) { const classify = 'ABCDEFGHJKLMNOPQRSTWXYZ'; const boundaryChar = '驁簿錯鵽樲鰒餜靃攟鬠纙鞪黁漚曝裠鶸蜶籜鶩鑂韻糳'; let idx = -1; if(!String.prototype.localeCompare) { throw Error('String.prototype.localeCompare not supported.'); } if(/[^\u4e00-\u9fa5]/.test(c)) { return c; } for (let i = 0; i < boundaryChar.length; i++) { if(boundaryChar[i].localeCompare(c, 'zh-CN-u-co-pinyin') >= 0) { idx = i; break; } } return classify[idx]; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: