function title
title(text: string): string

Converts the string to Title Case. This will capitalize the letter of each word that is separated by a space. Underscores are considered spaces. Hyphens are respected.

Examples

Example 1

title(null); // ""
title("hello world"); // Hello World
title("hello-world"); // Hello-world
title("hello_world"); // Hello World
title("HELLO wORLD"); // Hello World

Parameters

text: string

Return Type

string

Usage

import { title } from ".";