September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 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