🔝 Converts the first character of a string to upper case and the remaining to lower case.

Syntax

TypeScript
import { capitalize } from '@opentf/std';

capitalize(str: string): string

Parameters

  • str: The string to capitalize.

Returns

The capitalized string.

Examples

TypeScript
capitalize('abc') //=> 'Abc'

capitalize('FOO') //=> 'Foo'

capitalize('the quick brown fox') //=> 'The quick brown fox'

capitalize('1apple') //=> '1apple'
Last updated on
Edit this page