upperCase

将字符串转换为全大写,单词间用空格分隔 (HELLO WORLD)。

用法

将字符串转换为大写格式,单词之间用空格分隔。

import { upperCase } from '@movk/core'

upperCase('firstName') // => 'FIRST NAME'
upperCase('first_name') // => 'FIRST NAME'
upperCase('first-name') // => 'FIRST NAME'
upperCase('XMLHttpRequest') // => 'XML HTTP REQUEST'

API

upperCase(str: string): string

参数

str
string required
要转换的字符串。

返回值

string
返回大写格式的字符串。

Changelog

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

Copyright © 2024 - 2026 YiXuan - MIT License