Skip to content

Commit

Permalink
chore: Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rudashi committed Jan 29, 2024
1 parent eea269d commit ebb6342
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
12 changes: 12 additions & 0 deletions docs/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
- [whenIsUuid](#whenisuuid)
- [whenTest](#whentest)
- [wordCount](#wordcount)
- [wordWrap](#wordwrap)
- [words](#words)
- [wrap](#wrap)
- [value](#value)
Expand Down Expand Up @@ -1006,6 +1007,17 @@ Stringable.of('Hello, world!').wordCount();

// 2
```
### wordWrap
The `wordWrap` method wraps a string to a given number of characters:
```js
Stringable.of('The quick brown fox jumped over the lazy dog').wordWrap(20, "<br />\n");

/*
The quick brown fox<br />
jumped over the lazy<br />
dog.
*/
```
### words
The `words` method limits the number of words in a string. If necessary, you may specify an additional string that will be appended to the truncated string:
```js
Expand Down
14 changes: 13 additions & 1 deletion docs/statics.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@
- [ucsplit](#ucsplit)
- [upper](#upper)
- [wordCount](#wordcount)
- [wordWrap](#wordwrap)
- [words](#words)
- [wrap](#wrap)
- [preg_quote](#pregquote)
- [preg_quote](#preg_quote)
- [random](#random)
- [createRandomStringsUsing](#createrandomstringsusing)
- [createRandomStringsUsingSequence](#createrandomstringsusingsequence)
Expand Down Expand Up @@ -721,6 +722,17 @@ Str.wordCount('Hello, world!');

// 2
```
### wordWrap
The `wordWrap` function wraps a string to a given number of characters:
```js
Str.wordWrap('The quick brown fox jumped over the lazy dog', 20, "<br />\n");

/*
The quick brown fox<br />
jumped over the lazy<br />
dog.
*/
```
### uuid
The `uuid` function generates a UUID (version 4):
```js
Expand Down

0 comments on commit ebb6342

Please sign in to comment.