lowerCase()
lowerCase(
str):string
Converts string to lower case with space-separated words.
Parametersβ
str: string | null | undefinedβ
The string to convert.
Returns: stringβ
The lower cased string with words separated by spaces.
See Alsoβ
Sinceβ
2.0.0
Performanceβ
O(n) β charCode word splitting for short ASCII, regex for long/Unicode/emoji.
Also known asβ
lowerCase (Lodash, es-toolkit) Β· β (Remeda, Radashi, Ramda, Effect, Modern Dash, Antfu)
Exampleβ
lowerCase('--Foo-Bar--'); // => 'foo bar'
lowerCase('fooBar'); // => 'foo bar'
lowerCase('__FOO_BAR__'); // => 'foo bar'
How it works?β
Converts string to space-separated lowercase words. Splits on case boundaries, underscores, hyphens, and emojis. Supports Unicode.
Conversion Examplesβ
| Input | Output |
|---|---|
'--Foo-Bar--' | 'foo bar' |
'fooBar' | 'foo bar' |
'__FOO_BAR__' | 'foo bar' |
'ΓoΓ±oCase' | 'Γ±oΓ±o case' |
Processβ
Use Casesβ
Convert to lower case words πβ
Convert string to space-separated lowercase words. Useful for display labels or normalizing mixed-case input.
lowerCase('fooBar'); // => 'foo bar'
lowerCase('__FOO_BAR__'); // => 'foo bar'
lowerCase('--Foo-Bar--'); // => 'foo bar'
Normalize text for displayβ
Format programmatic identifiers into human-readable labels.
const label = lowerCase('backgroundColor');
// => 'background color'