会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
前端辑
前端集
首页
新随笔
联系
管理
2023年12月18日
字符串长度返回:1中文=2个字符,其它都是1个字符,包括emoji都是一个字符长度
摘要: // 字符串长度返回:1中文=2个字符,其它都是1个字符 export function getLength(str: any) { let strLength = 0; for (let i = 0; i < str.length; i++) { if (/[\u4e00-\u9fa5]/.tes
阅读全文
posted @ 2023-12-18 15:52 yoona-lin
阅读(3)
评论(0)
推荐(0)
编辑