企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## startsWith + [link](./startsWith "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L12546 "View in source.") + [npm](https://www.npmjs.com/package/lodash.startswith "See the npm package.") ``` _.startsWith([string=''], [target], [position=0]) ``` 检查字符串是否以 `target` 开头。 ### 参数 1. [string=''] (string) 要检索的字符串 2. [target] (string) 要检查的字符串 3. [position=0] (number) 检索的位置 ### 返回值 (boolean) 如果符合条件返回`true`,否则返回 `false` ### 示例 ``` _.startsWith('abc', 'a'); // => true _.startsWith('abc', 'b'); // => false _.startsWith('abc', 'b', 1); // => true ```