Skip to content

Commit 31f12a1

Browse files
TrottBridgeAR
authored andcommitted
doc: improve buf.lastIndexOf() text
Improve description of `encoding` option. (This change is also applied to `buf.indexOf()`.) Improve punctuation. Wrap at 80 characters. PR-URL: nodejs#19904 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent f712fbd commit 31f12a1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/api/buffer.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,9 +1240,10 @@ changes:
12401240

12411241
* `value` {string|Buffer|Uint8Array|integer} What to search for.
12421242
* `byteOffset` {integer} Where to begin searching in `buf`. **Default:** `0`.
1243-
* `encoding` {string} The encoding of `value` if `value` is a string.
1244-
**Default:** `'utf8'`.
1245-
* Returns: {integer} The index of the first occurrence of `value` in `buf` or
1243+
* `encoding` {string} If `value` is a string, this is the encoding used to
1244+
determine the binary representation of the string that will be searched for in
1245+
`buf`. **Default:** `'utf8'`.
1246+
* Returns: {integer} The index of the first occurrence of `value` in `buf`, or
12461247
`-1` if `buf` does not contain `value`.
12471248

12481249
If `value` is:

0 commit comments

Comments
 (0)