当前位置:网站首页>js takes the value of a feature at a certain position in the string, such as Huawei=> Huawei
js takes the value of a feature at a certain position in the string, such as Huawei=> Huawei
2022-08-02 03:38:00 【suzhiwei_boke】
let brandName = ' '
if (item.name.indexOf('(') !== -1) {
const index = item.name.lastIndexOf('\(') // Determine if the name has (), if so, remove it
brandName = item.name.substring(0, index)
} else {
brandName = item.name
}
Inspect two knowledge points, the string search indexOf() value is -1, it does not exist
边栏推荐
- AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
- 磷脂-聚乙二醇-叠氮,DSPE-PEG-Azide,DSPE-PEG-N3,MW:5000
- 针对简历上的问题
- subprocess.CalledProcessError: Command ‘pip install ‘thop‘‘ returned non-zero exit status 1.
- Phospholipid-polyethylene glycol-hydrazide, DSPE-PEG-Hydrazide, DSPE-PEG-HZ, MW: 5000
- MySQL中JOIN的用法
- npm和package.json
- Deveco studio Hongmeng app access network detailed process (js)
- 远程调试、无cuDnn、自定义模块无法导入问题记录
- 环形链表---------约瑟夫问题
猜你喜欢
随机推荐
L1-043 阅览室 (20分)
PCL—point cloud data segmentation
Cut out web icons through PS 2021
C语言 void和void *(无类型指针)
3 minutes to take you to understand WeChat applet development
Chemical reagent Phospholipid-polyethylene glycol-hydroxyl, DSPE-PEG-OH, DSPE-PEG-Hydroxyl, MW: 5000
广州华为面试总结
getattr() function analysis
最新,每天填坑,Jeston TX1 精卫填坑,第一步:刷机
Detailed explanation of the usage of exists in mysql
Source Insight 使用教程(2)——常用功能
How to check whether a table is locked in mysql
Redis simple study notes
ModuleNotFoundError No module named 'xxx' possible solutions
getattr()函数解析
【我的创作纪念日】 3周年
docker 安装 sqlserver中的坑点
Scientific research reagent DMPE-PEG-Mal dimyristoylphosphatidylethanolamine-polyethylene glycol-maleimide
debian 10 nat 与路由转发
错误:with open(txt_path,‘r‘) as f: FileNotFoundError: [Errno 2] No such file or directory: