当前位置:网站首页>JS string combination
JS string combination
2022-06-12 10:20:00 【Qu Shuai 369】
Note that the data types should be consistent
// add to
function strAdd(str1, str2){
if(str1 == null || str1 == '')
return str2;
if(str2 == null || str2 =='')
return str1;
var ary = str1.split(",");
ary.push(str2);
return ary.join(",");
}
// Delete
function strDel(str1, str2){
if(str1 == null || str1 == '')
return "";
if(str2 == null || str2 == '')
return str1;
var ary = str1.split(",");
var index = ary.indexOf(str2);
if (index > -1) {
ary.splice(index, 1);
}
return ary.join(",");
}
边栏推荐
- [CEGUI] log system
- How high can C language reach by self-study alone?
- Propagation of transactions
- Redis (II) Memory mapped data structure
- [CEGUI] font loading optimization
- properties中文乱码
- Introduction to on-line circuit simulation and open source electronic hardware design
- IoT简介
- How PLC constructs shift function block (FC) by itself
- FPGA VGA display based on de2-115 platform
猜你喜欢

How high can C language reach by self-study alone?

Student management system

C 语言仅凭自学能到什么高度?

机器学习之数据处理与可视化【鸢尾花数据分类|特征属性比较】

HALCON联合C#检测表面缺陷——仿射变换(三)

Add jar package under idea2018 web project

Shen Min, CIO of science and technology innovator Digital China Group: the best practice model is failing, and open source accelerates Distributed Innovation
![[Mozilla] basic concept analysis of IPDL](/img/b2/97b4db069052133ee614ecb1a8369e.jpg)
[Mozilla] basic concept analysis of IPDL

Raw socket usage

MySQL 7 affair
随机推荐
【ParquetEncodingException: empty fields are illegal, the field should be ommited completely instead
How high can C language reach by self-study alone?
ASP.NET Core权限系统实战(零)
在一个“去QA化”的项目中,QA能做什么?
[CEGUI] log system
Pycharm view the current version of opencv
CONDA install tensorflow test tensorflow
[DDS] ddsi-rtps specification
ServletContext object
PLC如何自行构造移位功能块(FC)
[chromium] location information kernel debugging
一测两三年,记测试交流经验的一些感想
Detailed explanation and use of redis data types: key and string types
2021-02-22
C break continue return
性能指标的信仰危机
[MySQL] learn more about the clustered indexes and auxiliary indexes (b+ tree indexes) in InnoDB
One test for twoorthree years, recording some thoughts on test exchange experience
tp6调试(trace)
JVM (VI) Virtual machine bytecode execution engine (with stack execution process and bytecode instruction table)