🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
如果需要检查字符串是否以特定序列开始或结束,可以使用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 ```