Maxbad`Blog

JavaScript 函数使用

2021-08-03 · 1 min read

startsWith

查看字符串是否为 "xxx" 开头:

var str = "Hello world, welcome to the Runoob.";
var n = str.startsWith("Hello");