Skip to content

upperFirst

首字母大写。

用法

js
import { upperFirst } from 'js-cool'

签名

typescript
function upperFirst(string: string): string

参数

参数类型描述
stringstring要修改的字符串

返回值

string - 首字母大写的字符串。

示例

js
upperFirst('hello') // 'Hello'
upperFirst('hello world') // 'Hello world'
upperFirst('h') // 'H'

基于 MIT 许可发布