当前位置:网站首页>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(",");
}
边栏推荐
- 2022淘宝618超级喵运会玩法来了 超级喵运会有哪些攻略方法
- tp6调试(trace)
- How high can C language reach by self-study alone?
- [CEGUI] resource loading process
- MySQL VI Database lock
- Circuitbreaker fuse of resilience4j -- Measurement of circuitbreakermetrics index
- Create simple windowing programs using Visual Studio 2017
- Papaya Mobile: cross border marketing has entered the era of "information flow", allowing independent station sellers to share opportunities to go to sea
- [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
猜你喜欢

Web3.0与数字时尚,该如何落地?

MQTT 协议中文版
![[CEGUI] resource loading process](/img/52/819843db21549b5e5031258f2c5cb0.jpg)
[CEGUI] resource loading process

机器学习不是你想用,想用就能用

Tp6 debugging (trace)

【实验】MySQL主从复制及读写分离

2. factory mode

原始套接字使用

JVM (VI) Virtual machine bytecode execution engine (with stack execution process and bytecode instruction table)
![[Wayland] Wayland introduction and customized guidance](/img/4e/655d484ca7787f39aab446fdb1ae74.jpg)
[Wayland] Wayland introduction and customized guidance
随机推荐
Win10 professional edition user name modification
Code types and data structures corresponding to the five object types of redis
ServletContext object
一测两三年,记测试交流经验的一些感想
极速搭建元宇宙画廊 #oncyber.io
VSCode代码调试技巧
MySQL VI Database lock
How Qualcomm platform modifies special voltage
redis学习记录:字典(dict)源码分析
HALCON联合C#检测表面缺陷——仿射变换(三)
OpenCV中CLAHE用于16位图像增强显示
Unable to load dynamic library ‘oci8_ 12C 'or unable to load dynamic library' PDO_ OCI 'or cannot find module
在一个“去QA化”的项目中,QA能做什么?
Add jar package under idea2018 web project
一文读懂Dfinity生态中的首个NFT平台:IMPOSSIBLE THINGS
CLAHE in opencv for 16 bit image enhancement display
Circuitbreaker fuse of resilience4j - circuitbreakerconfig configuration
2021-02-21
MySQL 7 affair
Using C language code to realize factory LCD RGB test program