Skip to content

Function.sentenceCase

github-actions[bot] edited this page Nov 18, 2026 · 13 revisions

umt / sentenceCase

Function: sentenceCase()

sentenceCase(string_): string

Defined in: String/sentenceCase.ts:15

Converts a string to Sentence case: the first word capitalized, every other word lower case, all separated by single spaces. Words are split with words.

Parameters

string_

string

Input string

Returns

string

Sentence case string

Example

sentenceCase("helloWorld foo-bar"); // "Hello world foo bar"
sentenceCase("XMLHttpRequest"); // "Xml http request"
sentenceCase(""); // ""

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally