-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
find
and rfind
return different values when the string that is being searched for has length 0.
Example
import strutils
doAssert "abc".find("") == 0
doAssert "abc".rfind("") == -1
Current Output
Both assertions pass.
Expected Output
One of the following:
find
andrfind
both return 0find
andrfind
both return -1find
returnslow("abc")
, andrfind
returnshigh("abc")
Which one is the best?
Additional Information
git hash cfe1924
$ nim -v
Nim Compiler Version 1.5.1 [Linux: amd64]
Compiled at 2021-05-29
Copyright (c) 2006-2021 by Andreas Rumpf
git hash: cfe19247e856950f7facaf7adbc50bca8dec3990
active boot switches: -d:release
Metadata
Metadata
Assignees
Labels
No labels