合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
如果需要检查字符串是否以特定序列开始或结束,可以使用startsWith 和endsWith 方法。 ``` // Use startsWith and endsWith methods to check if a string starts or ends with a specific sequence const str = "Hello, world!"; console.log(str.startsWith("Hello")); // true console.log(str.endsWith("world")); // false ```