Skip to content

Commit

Permalink
Merge pull request #136 from ldez/feature/missing-doc
Browse files Browse the repository at this point in the history
doc: adds missing documentation.
  • Loading branch information
technosophos authored Feb 12, 2019
2 parents bddad17 + 4b871e6 commit 7436748
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ Trim just the suffix from a string:
trimSuffix "-" "hello-"
```

## trimPrefix

Trim just the suffix from a string:

```
trimPrefix "-" "-hello"
```

The above returns `hello`

## upper
Expand Down Expand Up @@ -324,6 +332,24 @@ kebabcase "FirstName"

This above will produce `first-name`.

## swapcase

Swap the case of a string using a word based algorithm.

Conversion algorithm:

- Upper case character converts to Lower case
- Title case character converts to Lower case
- Lower case character after Whitespace or at start converts to Title case
- Other Lower case character converts to Upper case
- Whitespace is defined by unicode.IsSpace(char).

```
swapcase "This Is A.Test"
```

This above will produce `tHIS iS a.tEST`.

## shuffle

Shuffle a string.
Expand Down

0 comments on commit 7436748

Please sign in to comment.