Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,14 @@
|
|||
// version 1.1
|
||||
|
||||
fun isNumeric(input: String): Boolean =
|
||||
try {
|
||||
input.toDouble()
|
||||
true
|
||||
} catch(e: NumberFormatException) {
|
||||
false
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val inputs = arrayOf("152", "-3.1415926", "Foo123", "-0", "456bar", "1.0E10")
|
||||
for (input in inputs) println("$input is ${if (isNumeric(input)) "numeric" else "not numeric"}")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue