Skip to content

Instantly share code, notes, and snippets.

@gahfy
Created December 13, 2020 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gahfy/621817536f03f779f89cd613a5d83f42 to your computer and use it in GitHub Desktop.
Save gahfy/621817536f03f779f89cd613a5d83f42 to your computer and use it in GitHub Desktop.
fun main(){
val context = StateContext()
val test1 = "123."
val test2 = "123er45"
val test3 = "-145.36"
println("$test1 is ${if(context.parseString(test1)) "" else "not "}a valid number.")
println("$test2 is ${if(context.parseString(test2)) "" else "not "}a valid number.")
println("$test3 is ${if(context.parseString(test3)) "" else "not "}a valid number.")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment