mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-19 23:41:29 +00:00
Add space to fix RST in captureBetween docs (#5769)
This commit is contained in:
committed by
Andreas Rumpf
parent
202ecdeee8
commit
c24dc7944a
@@ -201,7 +201,7 @@ proc parseWhile*(s: string, token: var string, validChars: set[char],
|
||||
|
||||
proc captureBetween*(s: string, first: char, second = '\0', start = 0): string =
|
||||
## Finds the first occurrence of ``first``, then returns everything from there
|
||||
## up to ``second``(if ``second`` is '\0', then ``first`` is used).
|
||||
## up to ``second`` (if ``second`` is '\0', then ``first`` is used).
|
||||
var i = skipUntil(s, first, start)+1+start
|
||||
result = ""
|
||||
discard s.parseUntil(result, if second == '\0': first else: second, i)
|
||||
|
||||
Reference in New Issue
Block a user