作者:苏静梅构_164 | 来源:互联网 | 2023-10-10 21:20
字符串去重functionuniqStr(str){varstrstr.split();varzarr[];for(vari0;i<str.length;i++){if(
字符串去重
function uniqStr(str) {
var str = str.split('');
var zarr = [];
for (var i = 0; i
将字符放在对象中遍历拼接出字符串
function sc(str) {
var obj = {
r: "s",
o: "i",
t: "c",
n: "u",
F: "a"
};
var g = Object.keys(obj).concat(Object.values(obj));
var str = str.split('/');
var sr = '';
for (var i = 0; i
把字符串的奇数位和偶数位分别提取到两个数组中
var str = "abcdef";
var a = str.split('');
var b = [];
var c = [];
for (var i = 0; i
将两个数组按奇数位和偶数位插入拼接为字符串
function jiou(b, c) {
var b = b.split('');
var c = c.split('');
var m = [];
for (var i = 0; i
好了这篇文章就介绍到这了,感谢js猫同学的分享。