Skip to content

Instantly share code, notes, and snippets.

@gorrotowi
Created July 26, 2018 00:16
Show Gist options
  • Save gorrotowi/cae94722d3823567b53c548f55c2bcfb to your computer and use it in GitHub Desktop.
Save gorrotowi/cae94722d3823567b53c548f55c2bcfb to your computer and use it in GitHub Desktop.
Use data if objects is not null
val name:String? = null
val l:Int = if(name != null) name.length else -1
print(l) // -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment