前言
例如 “中国” 的首字母就是 “Z”,我们需要通过代码来自动判断从而得出结果。
本文介绍在小程序中,如何从 0-1 完成。
您可以传入中文字,会自动返回其首字母,可控制大小写。
console.log(pin.getLetter('中国'))// z
console.log(pin.getLetter('韩国')