1 Star 0 Fork 0

jean/js20240315

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
07_字符串02.html 1014 Bytes
一键复制 编辑 原始数据 按行查看 历史
jean 提交于 2024-03-25 11:22 . 'dom'
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script type="text/javascript">
var str="hello world"
console.log(str.indexOf('o'))
console.log(str.lastIndexOf('o'))
console.log(str.indexOf('o',5))
console.log(str.indexOf('html'))
var str1=' \t\vhello world\r\n '
console.log(str1.length)
console.log(str1.trim().length)
var str2="\'hello\' world"
console.log(str2)
var str3='"hello" world'
console.log(str3)
var str4='\'hello\' world'
console.log(str4)
var str5='hello\nworld'
console.log(str5)
// 空额
var str6='hello\
world'
console.log(str6)
var arr1= "hello,world, I, am, coming".split(",")
console.log(arr1)
var arr2="hello".split()
console.log(arr2)
var arr3="hello".split("")
console.log(arr3)
var str7=arr3.join(",")
console.log(str7)
var str7=" hello world "
console.log("end:",str7.trimEnd())
</script>
</head>
<body>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/jean123/js20240315.git
git@gitee.com:jean123/js20240315.git
jean123
js20240315
js20240315
master

搜索帮助