RosettaCodeData/Task/Determine-if-a-string-is-numeric/Nu/determine-if-a-string-is-numeric.nu
2023-12-16 21:33:55 -08:00

3 lines
145 B
Text

def is-numeric [] {try {into float | true} catch {false}}
["1" "12" "-3" "5.6" "-3.14" "one" "cheese"] | each {{k: $in, v: ($in | is-numeric)}}