当前位置:网站首页>Intercept based on byte length
Intercept based on byte length
2022-06-25 13:17:00 【liminla!】
const toLongStr = item.value.replace(/[^x00-xFF]/g, "**");
if (toLongStr.length > 30) {
let num = 0;
for (let i = 0; i < 30; i++) {
if (toLongStr.indexOf("*", i)) {
num++;
}
}
item.toLongStr = item.value.substr(0, 30 - num / 2);
item.toLong = true;
} else {
item.toLong = false;
}
边栏推荐
- [转]以终为始,详细分析高考志愿该怎么填
- MySQL learning notes
- 提高排名的 15 个基本 SEO 技巧
- Pointer, it has to say that the subject
- Oral English - continuous reading
- Sword finger offer II 028 Flatten multi-level bidirectional linked list
- Solve the problem that yarn cannot load files in vs Code
- . NET in China - What's New in . NET
- Some knowledge about structure, enumeration and union
- Django框架——缓存、信号、跨站请求伪造、 跨域问题、cookie-session-token
猜你喜欢

nacos无法修改配置文件Mysql8.0的解决方法

关于数据在内存中存储的相关例题

Sword finger offer day 2 linked list (simple)

WIN10环境下配置pytorch

Maui's learning path (II) -- setting

Shenzhen mintai'an intelligent second side_ The first offer of autumn recruitment

Summer Ending

Which Chinese virtual human is better? Sullivan, IDC: Xiaobing Baidu Shangtang ranks in the first echelon

二叉树之_哈夫曼树_哈弗曼编码

Golang keyboard input statement scanln scanf code example
随机推荐
[visio] solving the fuzzy problem of parallelogram in word
Maui的学习之路(二)--设置
[machine learning] model and cost function
Assemble relevant knowledge points of flag bit (connected)
Configuring pytorch in win10 environment
Module 5 (microblog comments)
WIN10环境下配置pytorch
字节跳动Dev Better技术沙龙来啦!参与活动赢好礼,限时免费报名中!
重磅直播|BizDevOps:数字化转型浪潮下的技术破局之路
关于一道教材题的讲解
Seven competencies required by architects
Sword finger offer day 3 string (simple)
Analyse de l'optimisation de la réécriture des requêtes lazyagg de l'entrepôt
[pit avoidance refers to "difficult"] halfcheckedkeys rendering problem in semi selected status of antd tree
Oral English - continuous reading
Maui's learning path (II) -- setting
二叉树之_哈夫曼树_哈弗曼编码
用include what you use拯救混乱的头文件
三行代码简单修改jar包的项目代码
一篇文章讲清楚MySQL的聚簇/联合/覆盖索引、回表、索引下推