字符串的split和join
发表于|更新于
|浏览量:
split() 将字符串拆分成数组
join() 将数组合并
参数为分隔符
两套代码
1 | #JavaScript |
以及
1 | //java |
相关推荐
2021-06-27
before和after选择器
在科学上没有平坦的大道,只有不畏劳苦,沿着陡峭山路攀登的人,才有希望达到光辉的顶点——马克思 我们可以使用::before和::after去选择我们节点内部的首项或尾项 例如我这里代码如下 123456789101112131415161718192021222324252627282930313233343536<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title></title> <style> .ruben-parent { width: 100%; border: 0.1em solid #ababab; text-align: center; } .ruben-parent::before, .ruben-parent::after { margin: 0 auto; content: ''; ...
2022-01-06
js生成二维码
我们飞得越高,我们在那些不能飞的人眼中的形象就越渺小。——尼采《查拉图斯特拉如是说》 我们使用qrcodejs生成:https://github.com/davidshimjs/qrcodejs 下载这个js并引用 不知道怎么下载的可以直接到这个链接下按ctrl+s另存为 https://raw.githubusercontent.com/davidshimjs/qrcodejs/master/qrcode.min.js 然后编写代码: 123456789101112131415161718192021<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title></title> <script src="./js/qrcode.min.js" type="text/javascript"></script> </head> <body>...
2024-10-29
typescript-exercises(三)
青年人的教育是国家的基石。——富兰克林 题面: 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970/*Intro: Since we already have some of the additional information about our users, it's a good idea to output it in a nice way.Exercise: Fix type errors in logPerson function. logPerson function should accept both User and Admin and should output relevant information according to the input: occupation for User an...
2023-11-23
toastify-js
无论掌握哪一种知识,对智力都是有用的,它会把无用的东西抛开而把好的东西保留住。——达·芬奇 分享一个前端消息提示组件库ToastifyJs https://github.com/apvarun/toastify-js 引入: 1npm install --save toastify-js 或者 123<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css"><script src="https://cdn.jsdelivr.net/npm/toastify-js"></script> 使用: 1Toastify({ text: "This is a toast", duration: 3000 }).showToast(); 复杂例子: 123456789101...
2022-05-17
display:contents
多少人以友谊的名义,爱着一个人。——电影《One Day》 MDN:https://developer.mozilla.org/zh-CN/docs/Web/CSS/display-box 首先是一段代码: 12345678910111213141516171819<!DOCTYPE html><head> <title>display</title> <style> .outer { border: 2px solid red; width: 300px; } .outer>div { border: 1px solid green; } </style></head><body> <div class="outer"> <div>I...
2020-11-28
setInterval
坍圮的殿堂总还是庙,冷落的圣像依然是神。 在前端开发中我们或许想定时做一些操作 可以使用一个setInterval函数去做 123456// 定时控制台打印rubensetInterval(function () { console.log("ruben");}, 1000);// 定时控制台打印achao,注意这里是使用字符串形式写法setInterval('console.log("achao");', 1000); 可以打开控制台看到效果

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog