Skip to content

Instantly share code, notes, and snippets.

@quiro91
Created January 29, 2018 21:02
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 quiro91/1704c6a98193dba8b84a104e8c71edc9 to your computer and use it in GitHub Desktop.
Save quiro91/1704c6a98193dba8b84a104e8c71edc9 to your computer and use it in GitHub Desktop.
var something: String? = getSomething()
fun main(args: Array<String>) {
nowItsNotAVarAnymore(something)
}
fun nowItsNotAVarAnymore(param: String?) {
if (param) {
println("Param is not nullable and contains ${param.length} characters)
} else {
println("Param was nullable")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment