当前位置:网站首页>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则不存在
边栏推荐
- @Autowired注解的使用
- 磷脂-聚乙二醇-靶向新生血管靶向肽APRPG,DSPE-PEG-APRPG
- 2022年比若依更香的开源项目
- 跨域问题解决
- Error: with open(txt_path,'r') as f: FileNotFoundError: [Errno 2] No such file or directory:
- A senior test engineer asked me these questions as soon as the interview came
- 【装机】老毛桃的安装及使用
- 啃瓜记录第一天
- np.isnan()
- ModuleNotFoundError No module named ‘xxx‘可能的解决方案大全
猜你喜欢

DSPE-PEG-PDP,DSPE-PEG-OPSS,磷脂-聚乙二醇-巯基吡啶供应,MW:5000

ModuleNotFoundError No module named ‘xxx‘可能的解决方案大全

知识工程作业2:知识工程相关领域介绍

Redis笔记进阶篇:万字长文-整理Redis,各种知识点,建议收藏

MySQL常见的索引

Phospholipid-polyethylene glycol-thiol, DSPE-PEG-Thiol, DSPE-PEG-SH, MW: 5000

Chemical reagent Phospholipid-polyethylene glycol-hydroxyl, DSPE-PEG-OH, DSPE-PEG-Hydroxyl, MW: 5000

磷脂-聚乙二醇-酰肼,DSPE-PEG-Hydrazide,DSPE-PEG-HZ,MW:5000

Chapter 10 Clustering

【手把手带你学nRF52832/nRF52840 · (1)开发环境搭建】
随机推荐
MySQL两阶段提交串讲
MySQL中字符串比较大小(日期字符串比较问题)
Dynamic proxy tool class
磷脂-聚乙二醇-酰肼,DSPE-PEG-Hydrazide,DSPE-PEG-HZ,MW:5000
MySQL分页查询的5种方法
@ApiModel 和 @ApiModelProperty
磷脂-聚乙二醇-巯基,DSPE-PEG-Thiol,DSPE-PEG-SH,MW:5000
解决glob()返回文件排序不一致问题&onnx本地按照安装方法
DSPE-PEG-DBCO Phospholipid-Polyethylene Glycol-Dibenzocyclooctyne A Linear Heterobifunctional Pegylation Reagent
ModuleNotFoundError No module named 'xxx' possible solutions
redis进行持久化时,有新的写操作将如何解决——写时复制
AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
Scientific research reagent DMPE-PEG-Mal dimyristoylphosphatidylethanolamine-polyethylene glycol-maleimide
mysql8.0安装教程与配置(最详细)操作简单
oracle inner join and outer join
Basic usage of Monaco Editor
Mysql8.0安装教程
nucleo stm32 h743 FREERTOS CUBE MX配置小记录
SOCKS5
语义分割标签即像素值的巨坑,transforms.ToTensor()的错误使用