> For the complete documentation index, see [llms.txt](https://lodash.shujuwajue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lodash.shujuwajue.com/string/camelcase.md).

# \_.camelCase（转驼峰）

**语法：**

```javascript
_.camelCase([string=''])
```

**源代码链接：**[source](https://github.com/lodash/lodash/blob/4.17.10/lodash.js#L14138)

**npm包链接：**[npm package](https://www.npmjs.com/package/lodash.camelcase)

**描述：**

转换字符串`string`为[驼峰写法](https://en.wikipedia.org/wiki/CamelCase)。

**开始版本：**&#x33;.0.0

**参数：**

* `[string=''] (string)`: 要转换的字符串。&#x20;

**返回值：**

* `(string)`: 返回驼峰写法的字符串。

**例子：**

```javascript
_.camelCase('Foo Bar');
// => 'fooBar'

_.camelCase('--foo-bar--');
// => 'fooBar'

_.camelCase('__FOO_BAR__');
// => 'fooBar'
```
