Skip to main content
@spa-tools/utilities

capitalizeFirstWord()

The capitalizeFirstWord() function does just what is says :-).

Usage

import { capitalizeFirstWord } from '@spa-tools/utilities';

const result = capitalizeFirstWord('hello world');
console.log(result);
// --> Hello world

Arguments

NameTypeDescription
strstringThe string to capitalize first word for

Returns

Returns string.