当前位置:网站首页>js 取字符串中某位置某特征的值,如华为(Huawei)=>华为
js 取字符串中某位置某特征的值,如华为(Huawei)=>华为
2022-08-02 03:22:00 【suzhiwei_boke】
let brandName = ' '
if (item.name.indexOf('(') !== -1) {
const index = item.name.lastIndexOf('\(') // 判断名字是否有(),有则去掉
brandName = item.name.substring(0, index)
} else {
brandName = item.name
}
考察两个知识点,字符串查找 indexOf() 值为-1则不存在
边栏推荐
- The usage of json type field in mysql
- 磷脂-聚乙二醇-醛基 DSPE-PEG-Aldehyde DSPE-PEG-CHO MW:5000
- DSPE-PEG-PDP,DSPE-PEG-OPSS,磷脂-聚乙二醇-巯基吡啶供应,MW:5000
- MySQL8.0与MySQL5.7差异分析
- 利用 nucleo stm32 f767zi 进行USART+DMA+PWM输入模式 CUBE配置
- sh: 1: curl: not found
- 我的两周年创作纪念日
- String comparison size in MySQL (date string comparison problem)
- Deveco studio 鸿蒙app访问网络详细过程(js)
- 通过PS 2021 将网页图标抠下来
猜你喜欢

Phospholipid-polyethylene glycol-targeted neovascularization targeting peptide APRPG, DSPE-PEG-APRPG

Redis simple study notes

MySQL中JOIN的用法

Redis的集群模式

parser = argparse.ArgumentParser()解析

Phospholipid-Polyethylene Glycol-Aldehyde DSPE-PEG-Aldehyde DSPE-PEG-CHO MW: 5000

活体检测 Adaptive Normalized Representation Learning for GeneralizableFace Anti-Spoofing 阅读笔记

Deveco studio 鸿蒙app访问网络详细过程(js)

Phospholipid-polyethylene glycol-azide, DSPE-PEG-Azide, DSPE-PEG-N3, MW: 5000

@Configuration详解
随机推荐
分布式领域最重要的一篇论文,到底讲了什么?
DSPE-PEG-Silane,DSPE-PEG-SIL,磷脂-聚乙二醇-硅烷修饰活性基团
利用 nucleo stm32 f767zi 进行USART+DMA+PWM输入模式 CUBE配置
【我的创作纪念日】 3周年
@Configuration详解
[Mianjing] Mihayou data development on one side and two sides
SOCKS5
Phospholipid-polyethylene glycol-thiol, DSPE-PEG-Thiol, DSPE-PEG-SH, MW: 5000
Redis安装,基本命令,持久化方式,集群
PCL—point cloud data segmentation
亚马逊卖家怎么提升转化率
Phospholipid-polyethylene glycol-hydrazide, DSPE-PEG-Hydrazide, DSPE-PEG-HZ, MW: 5000
nucleo stm32 h743 FREERTOS CUBE MX配置小记录
@Autowired详解[email protected]在static属性上的使用
[详解C语言]一文带你玩转C语言小游戏---三子棋
ModuleNotFoundError No module named 'xxx' possible solutions
MySQL常见的索引
【装机】老毛桃的安装及使用
UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the index ing argu
Detailed explanation of the usage of exists in mysql