mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
Merge pull request #3689 from rtfeldman/fix/3685-Str.splitLast
Fix Str.splitLast for needle positioned last
This commit is contained in:
commit
b4880ae66f
1 changed files with 1 additions and 1 deletions
|
@ -334,7 +334,7 @@ lastMatch : Str, Str -> [Some Nat, None]
|
|||
lastMatch = \haystack, needle ->
|
||||
haystackLength = Str.countUtf8Bytes haystack
|
||||
needleLength = Str.countUtf8Bytes needle
|
||||
lastPossibleIndex = Num.subSaturated haystackLength (needleLength + 1)
|
||||
lastPossibleIndex = Num.subSaturated haystackLength needleLength
|
||||
|
||||
lastMatchHelp haystack needle lastPossibleIndex
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue