mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 15:18:01 +00:00
24 lines
530 B
Markdown
24 lines
530 B
Markdown
# Capitalize All The Words
|
|
|
|
PostgreSQL provides the string function `initcap()` as a way of capitalizing
|
|
all words. In the process, it cleans up the casing of the remaining parts of
|
|
the words.
|
|
|
|
Here are some examples of how it works.
|
|
|
|
```sql
|
|
> select initcap('hello, world');
|
|
initcap
|
|
--------------
|
|
Hello, World
|
|
|
|
> select initcap('HELLO, WORLD');
|
|
initcap
|
|
--------------
|
|
Hello, World
|
|
```
|
|
|
|
See the [String Functions and Operators
|
|
docs](https://www.postgresql.org/docs/current/static/functions-string.html)
|
|
for more details.
|