Skip to content

Commit

Permalink
Merge pull request #494 from kevin-lee/update-docs-add-cases
Browse files Browse the repository at this point in the history
Update docs - `cases.md` - `cases` syntax from extras-string
  • Loading branch information
kevin-lee authored Nov 5, 2023
2 parents 1f3269b + f0a4337 commit 1e62f33
Show file tree
Hide file tree
Showing 3 changed files with 318 additions and 0 deletions.
310 changes: 310 additions & 0 deletions docs/extras-string/cases.md
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
```

4 changes: 4 additions & 0 deletions docs/extras-string/numeric.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ title: 'numeric syntax'
```scala mdoc
import extras.strings.syntax.numeric._
```
Or
```scala
import extras.strings.syntax.all._
```

## `numeric` syntax for `Int`

Expand Down
4 changes: 4 additions & 0 deletions docs/extras-string/strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ title: 'strings syntax'
```scala mdoc
import extras.strings.syntax.strings._
```
Or
```scala
import extras.strings.syntax.all._
```

## `commaWith(String)`

Expand Down

0 comments on commit 1e62f33

Please sign in to comment.