💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## 1.startWith--返回boolean值 ~~~ let url = "http://www.baidu.com"; let value = url.startsWith("http"); console.log(value); ~~~ ## 2.endWith ~~~ let url = "a.txt"; let value = url.endsWith(".txt"); if(value){ console.log("txt文件") } ~~~ ## 3.字符串模板 >作用:将变量放到字符串中 语法 ~~~ let a = 12; let str = `a${a}bc`; console.log(str); ~~~ 应用场景字符拼串 ~~~ //之前字符串这行要用\(转义字符) let title="good" let str = "<div>\ +title+</div>" ~~~ ~~~ //任意这行,插入变量 let title="good" let str = `<div> ${title}</div>` ~~~