-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #494 from kevin-lee/update-docs-add-cases
Update docs - `cases.md` - `cases` syntax from extras-string
- Loading branch information
Showing
3 changed files
with
318 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,310 @@ | ||
--- | ||
sidebar_position: 3 | ||
id: 'cases' | ||
title: 'cases syntax' | ||
--- | ||
|
||
## Import `cases` syntax | ||
|
||
```scala mdoc | ||
import extras.strings.syntax.cases._ | ||
``` | ||
Or | ||
```scala | ||
import extras.strings.syntax.all._ | ||
``` | ||
|
||
## Case Change for `String` | ||
|
||
### `String` to `PascalCase` | ||
|
||
```scala mdoc | ||
"Abc".toPascalCase | ||
|
||
"AbcDefGhi".toPascalCase | ||
|
||
"abcDefGhi".toPascalCase | ||
|
||
"abc".toPascalCase | ||
|
||
"ABC".toPascalCase | ||
|
||
"Abc_Def_Ghi".toPascalCase | ||
|
||
"abc_def_ghi".toPascalCase | ||
|
||
"abc__def__ghi".toPascalCase | ||
|
||
"Abc-Def-Ghi".toPascalCase | ||
|
||
"abc-def-ghi".toPascalCase | ||
|
||
"abc--def--ghi".toPascalCase | ||
|
||
"Abc Def Ghi".toPascalCase | ||
|
||
"abc def ghi".toPascalCase | ||
|
||
"AbcDef_Ghi_jkl-Mno-pqr Stu vwx".toPascalCase | ||
|
||
"AbcDef__Ghi___jkl--Mno---pqr Stu vwx".toPascalCase | ||
``` | ||
|
||
|
||
### `String` to one `PascalCase` | ||
```scala mdoc | ||
"Abc".toOnePascalCase | ||
|
||
"AbcDefGhi".toOnePascalCase | ||
|
||
"abcDefGhi".toOnePascalCase | ||
|
||
"abc".toOnePascalCase | ||
|
||
"ABC".toOnePascalCase | ||
|
||
"Abc_Def_Ghi".toOnePascalCase | ||
|
||
"abc_def_ghi".toOnePascalCase | ||
|
||
"abc__def__ghi".toOnePascalCase | ||
|
||
"Abc-Def-Ghi".toOnePascalCase | ||
|
||
"abc-def-ghi".toOnePascalCase | ||
|
||
"abc--def--ghi".toOnePascalCase | ||
|
||
"Abc Def Ghi".toOnePascalCase | ||
|
||
"abc def ghi".toOnePascalCase | ||
|
||
"AbcDef_Ghi_jkl-Mno-pqr Stu vwx".toOnePascalCase | ||
|
||
"AbcDef__Ghi___jkl--Mno---pqr Stu vwx".toOnePascalCase | ||
``` | ||
|
||
|
||
### `String` to `camelCase` | ||
```scala mdoc | ||
"Abc".toCamelCase | ||
|
||
"AbcDefGhi".toCamelCase | ||
|
||
"abcDefGhi".toCamelCase | ||
|
||
"abc".toCamelCase | ||
|
||
"ABC".toCamelCase | ||
|
||
"Abc_Def_Ghi".toCamelCase | ||
|
||
"abc_def_ghi".toCamelCase | ||
|
||
"abc__def__ghi".toCamelCase | ||
|
||
"Abc-Def-Ghi".toCamelCase | ||
|
||
"abc-def-ghi".toCamelCase | ||
|
||
"abc--def--ghi".toCamelCase | ||
|
||
"Abc Def Ghi".toCamelCase | ||
|
||
"abc def ghi".toCamelCase | ||
|
||
"AbcDef_Ghi_jkl-Mno-pqr Stu vwx".toCamelCase | ||
|
||
"AbcDef__Ghi___jkl--Mno---pqr Stu vwx".toCamelCase | ||
``` | ||
|
||
|
||
### `String` to `Snake_Case` | ||
```scala mdoc | ||
"Abc".toSnakeCase | ||
|
||
"AbcDefGhi".toSnakeCase | ||
|
||
"abcDefGhi".toSnakeCase | ||
|
||
"abc".toSnakeCase | ||
|
||
"ABC".toSnakeCase | ||
|
||
"Abc_Def_Ghi".toSnakeCase | ||
|
||
"abc_def_ghi".toSnakeCase | ||
|
||
"ABC_DEF_GHI".toSnakeCase | ||
|
||
"abc-def-ghi".toSnakeCase | ||
|
||
"Abc-Def-Ghi".toSnakeCase | ||
|
||
"ABC-DEF-GHI".toSnakeCase | ||
|
||
"abc def ghi".toSnakeCase | ||
|
||
"Abc Def Ghi".toSnakeCase | ||
|
||
"ABC DEF GHI".toSnakeCase | ||
``` | ||
|
||
|
||
### `String` to `SNAKE_UPPER_CASE` | ||
```scala mdoc | ||
"Abc".toSnakeUpperCase | ||
|
||
"AbcDefGhi".toSnakeUpperCase | ||
|
||
"abcDefGhi".toSnakeUpperCase | ||
|
||
"abc".toSnakeUpperCase | ||
|
||
"ABC".toSnakeUpperCase | ||
|
||
"Abc_Def_Ghi".toSnakeUpperCase | ||
|
||
"abc_def_ghi".toSnakeUpperCase | ||
|
||
"ABC_DEF_GHI".toSnakeUpperCase | ||
|
||
"abc-def-ghi".toSnakeUpperCase | ||
|
||
"Abc-Def-Ghi".toSnakeUpperCase | ||
|
||
"ABC-DEF-GHI".toSnakeUpperCase | ||
|
||
"abc def ghi".toSnakeUpperCase | ||
|
||
"Abc Def Ghi".toSnakeUpperCase | ||
|
||
"ABC DEF GHI".toSnakeUpperCase | ||
``` | ||
|
||
|
||
### `String` to `snake_lower_case` | ||
```scala mdoc | ||
"Abc".toSnakeLowerCase | ||
|
||
"AbcDefGhi".toSnakeLowerCase | ||
|
||
"abcDefGhi".toSnakeLowerCase | ||
|
||
"abc".toSnakeLowerCase | ||
|
||
"ABC".toSnakeLowerCase | ||
|
||
"Abc_Def_Ghi".toSnakeLowerCase | ||
|
||
"abc_def_ghi".toSnakeLowerCase | ||
|
||
"ABC_DEF_GHI".toSnakeLowerCase | ||
|
||
"abc-def-ghi".toSnakeLowerCase | ||
|
||
"Abc-Def-Ghi".toSnakeLowerCase | ||
|
||
"ABC-DEF-GHI".toSnakeLowerCase | ||
|
||
"abc def ghi".toSnakeLowerCase | ||
|
||
"Abc Def Ghi".toSnakeLowerCase | ||
|
||
"ABC DEF GHI".toSnakeLowerCase | ||
``` | ||
|
||
### `String` to `Kebab-Case` | ||
```scala mdoc | ||
"Abc".toKebabCase | ||
|
||
"AbcDefGhi".toKebabCase | ||
|
||
"abcDefGhi".toKebabCase | ||
|
||
"abc".toKebabCase | ||
|
||
"ABC".toKebabCase | ||
|
||
"Abc_Def_Ghi".toKebabCase | ||
|
||
"abc_def_ghi".toKebabCase | ||
|
||
"ABC_DEF_GHI".toKebabCase | ||
|
||
"abc-def-ghi".toKebabCase | ||
|
||
"Abc-Def-Ghi".toKebabCase | ||
|
||
"ABC-DEF-GHI".toKebabCase | ||
|
||
"abc def ghi".toKebabCase | ||
|
||
"Abc Def Ghi".toKebabCase | ||
|
||
"ABC DEF GHI".toKebabCase | ||
``` | ||
|
||
|
||
### `String` to `KEBAB-UPPER-CASE` | ||
```scala mdoc | ||
"Abc".toKebabUpperCase | ||
|
||
"AbcDefGhi".toKebabUpperCase | ||
|
||
"abcDefGhi".toKebabUpperCase | ||
|
||
"abc".toKebabUpperCase | ||
|
||
"ABC".toKebabUpperCase | ||
|
||
"Abc_Def_Ghi".toKebabUpperCase | ||
|
||
"abc_def_ghi".toKebabUpperCase | ||
|
||
"ABC_DEF_GHI".toKebabUpperCase | ||
|
||
"abc-def-ghi".toKebabUpperCase | ||
|
||
"Abc-Def-Ghi".toKebabUpperCase | ||
|
||
"ABC-DEF-GHI".toKebabUpperCase | ||
|
||
"abc def ghi".toKebabUpperCase | ||
|
||
"Abc Def Ghi".toKebabUpperCase | ||
|
||
"ABC DEF GHI".toKebabUpperCase | ||
``` | ||
|
||
### `String` to `kebab-lower-case` | ||
```scala mdoc | ||
"Abc".toKebabLowerCase | ||
|
||
"AbcDefGhi".toKebabLowerCase | ||
|
||
"abcDefGhi".toKebabLowerCase | ||
|
||
"abc".toKebabLowerCase | ||
|
||
"ABC".toKebabLowerCase | ||
|
||
"Abc_Def_Ghi".toKebabLowerCase | ||
|
||
"abc_def_ghi".toKebabLowerCase | ||
|
||
"ABC_DEF_GHI".toKebabLowerCase | ||
|
||
"abc-def-ghi".toKebabLowerCase | ||
|
||
"Abc-Def-Ghi".toKebabLowerCase | ||
|
||
"ABC-DEF-GHI".toKebabLowerCase | ||
|
||
"abc def ghi".toKebabLowerCase | ||
|
||
"Abc Def Ghi".toKebabLowerCase | ||
|
||
"ABC DEF GHI".toKebabLowerCase | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters