Skip to content

Instantly share code, notes, and snippets.

@gorrotowi
Created September 8, 2018 00:49
Show Gist options
  • Save gorrotowi/4bf2d2797a6b500b2b9f456e0a331fd6 to your computer and use it in GitHub Desktop.
Save gorrotowi/4bf2d2797a6b500b2b9f456e0a331fd6 to your computer and use it in GitHub Desktop.
val name:String? = null
var length:Int
if(name != null){
length = name.length
} else{
length = -1
}
print(length) // -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment