typedash
Version:
modern, type-safe collection of utility functions
14 lines (12 loc) • 363 B
TypeScript
/**
* Returns a new string with the first character capitalized.
* @param string The input string to capitalize.
* @returns A new string with the first character capitalized.
* @example
* ```ts
* capitalize('foo'); // 'Foo'
* capitalize(''); // ''
* ```
*/
declare function capitalize<S extends string>(string: S): Capitalize<S>;
export { capitalize };