1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-18 06:28:02 +00:00

Add Capitalize All The Words as a postgres til

This commit is contained in:
jbranchaud
2017-09-11 15:14:17 -05:00
parent 862b838a5d
commit 4c0395b554
2 changed files with 25 additions and 1 deletions

View File

@@ -0,0 +1,23 @@
# 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 example 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.