MCPcopy Create free account
hub / github.com/antfu/utils / capitalize

Function capitalize

src/string.ts:106–108  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

104 * ```
105 */
106export function capitalize(str: string): string {
107 return str[0].toUpperCase() + str.slice(1).toLowerCase()
108}
109
110const _reFullWs = /^\s*$/
111

Callers 1

string.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected