upperFirst

仅将字符串的第一个字母转换为大写。

upperFirst

仅将字符串的第一个字母转换为大写,其余部分保持不变。

用法

import { upperFirst } from '@movk/core'

upperFirst('foo bar') // => 'Foo bar'
upperFirst('FOO BAR') // => 'FOO BAR'

API

upperFirst(str: string): string

参数

str
string required
要转换的字符串。

返回值

string
返回首字母大写的字符串。

Changelog

No recent changes
Copyright © 2024 - 2025 YiXuan - MIT License