c2nim tool added
This commit is contained in:
parent
c441cdb64c
commit
d10973adb0
28 changed files with 3498 additions and 66 deletions
|
|
@ -391,10 +391,13 @@ proc endsWith(s, suffix: string): bool =
|
|||
var
|
||||
i = 0
|
||||
j = len(s) - len(suffix)
|
||||
while true:
|
||||
if suffix[i] == '\0': return true
|
||||
while i+j <% s.len:
|
||||
if s[i+j] != suffix[i]: return false
|
||||
inc(i)
|
||||
if suffix[i] == '\0': return true
|
||||
|
||||
# 012345
|
||||
# 345
|
||||
|
||||
when false:
|
||||
proc abbrev(s: string, possibilities: openarray[string]): int =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue