Like so.
import strutils
proc isNumber(x: string): bool =
try:
discard parseInt(x)
result = true
except ValueError:
result = false
RunThere are many other ways.
Like so.
import strutils
proc isNumber(x: string): bool =
try:
discard parseInt(x)
result = true
except ValueError:
result = false
RunThere are many other ways.