- Go Standard Library Cookbook
- Radomír Sohlich
- 54字
- 2021-06-24 18:56:35
Controlling case
There are a lot of practical tasks where the modification of case is the most common approach. Let's pick a few of these:
- Case-insensitive comparison
- Beginning the sentence with an automatic first capital
- Camel-case to snake-case conversion
For these purposes, the strings package offers functions ToLower, ToUpper, ToTitle, and Title.