Skip to content

Commit b655b90

Browse files
committed
Auto-generated commit
1 parent d2bb2df commit b655b90

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,14 @@ out = replaceBeforeLast( str, 'o', 'bar', str.length );
8989
To begin searching from a specific index, provide a corresponding `fromIndex` argument.
9090

9191
```javascript
92-
var str = 'beep boop beep';
93-
var out = replaceBeforeLast( str, ' ', 'loop', 5 );
92+
var out = replaceBeforeLast( 'beep boop beep', ' ', 'loop', 5 );
9493
// returns 'loop boop beep'
9594
```
9695

9796
If `fromIndex` is less than zero, the starting index is resolved relative to the last string character, with the last string character corresponding to `fromIndex = -1`.
9897

9998
```javascript
100-
var str = 'beep boop beep';
101-
var out = replaceBeforeLast( str, ' ', 'loop', -1 );
99+
var out = replaceBeforeLast( 'beep boop beep', ' ', 'loop', -1 );
102100
// returns 'loop beep'
103101
```
104102

docs/types/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
* - The function scans a provided string from the starting index to the beginning of the string (i.e., backward).
2727
* - If unable to find search string, the function returns the input string unchanged.
28-
* - If `fromIndex` is less than zero, the starting index is resolved relative to the last string chraacter, with the last string chraacter corresponding to `fromIndex = -1`.
28+
* - If `fromIndex` is less than zero, the starting index is resolved relative to the last string character, with the last string character corresponding to `fromIndex = -1`.
2929
*
3030
* @param str - input string
3131
* @param search - search string

0 commit comments

Comments
 (0)