concat //增加
indexOf //查询
1. 增加
基本的类型的方法都不可以改变他原来的值
slice
concat
var str=“hello world”
str =str.concat ("good");
console.log(str) //hello worldgood
2.查询
// slice
// substring 截取某一段
// substr 查询并可以输出一部分
indexOf 查询字符串值得下标
search 查询字符串值得下标 不存在时-1
startsWith turn/false
match //数组的方法 、、 返回匹配的值,是一个数组
replace
split
1.indexOf
可以查询字符串值得下标
console.log(str.indexOf("g")) //11
2.slice ,substring, substr
var str = "hello world";
console.log(str.slice(0,3)) // startIndex<=num<end
console.log(str.substring(0,3)) //hel
console.log(str.substr(0,4)) //hell
3.startsWith search
<script>
var str = 'hello world';
var http = "https://www.baidu.com"
console.log(str.search("e")) //1
console.log(http.startsWith("https")) //true
</script>
4.match
//数组的方法并非字符串方法
<script>
var str = "hello";
console.log(str.match("e")) //["e", index: 1, input: "hello", groups: undefined]
console.log(str.replace("l","g")) //heglo
</script>