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

b6146 — refactor: 统一源码文件命名为 camelCase

Copyright © 2024 - 2026 YiXuan - MIT License