> 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/capitalize.md).

# \_.capitalize（首字母大写其他小写）

**语法：**

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

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

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

**描述：**

转换字符串`string`首字母为大写，剩下为小写。

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

**参数：**

* `[string=''] (string)`: 要大写开头的字符串。

**返回值：**

* `(string)`: 返回大写开头的字符串。

**例子：**

```javascript
_.capitalize('FRED');
// => 'Fred'
```
