[backport] Fix typo and improve in code-block of 'lib/pure/parseutils.nim' (#13231) [ci skip]
This commit is contained in:
parent
7356bc29b7
commit
4a754ff392
1 changed files with 3 additions and 2 deletions
|
|
@ -29,13 +29,14 @@
|
|||
## import parseutils
|
||||
## from strutils import Digits, parseInt
|
||||
##
|
||||
## let userInput1 = "2019 school start"
|
||||
## let userInput2 = "3 years back"
|
||||
## let input1 = "2019 school start"
|
||||
## let input2 = "3 years back"
|
||||
##
|
||||
## let startYear = input1[0..skipWhile(input1, Digits)-1] # 2019
|
||||
## let yearsBack = input2[0..skipWhile(input2, Digits)-1] # 3
|
||||
##
|
||||
## echo "Examination is in " & $(parseInt(startYear) + parseInt(yearsBack))
|
||||
## # => Examination is in 2022
|
||||
##
|
||||
##
|
||||
## **See also:**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue