字符串数组容易搞混的方法以及地址拆分

来源:互联网 发布:csbte源码 编辑:程序博客网 时间:2024/06/07 01:15
字符串拆分substring(0,3)
数组拆分slice(0,3)
数组自定义删除和替换splice(2,3,"替换字符串")2代表位置,3代表数量,
数组结合concat
数组转字符串join("_")
location拆分url地址
http://www.example.com:8080/path/index.html?a=1&b=2#TOP
location.protocol; // 'http'
location.host; // 'www.example.com'
location.port; // '8080'
location.pathname; // '/path/index.html'
location.search; // '?a=1&b=2'
location.hash; // 'TOP'
0 0
原创粉丝点击