---
# System prepended metadata

title: Kotlin ビックリマーク二つ`!!`(Not-Null Assertion Operator) の意味 2021-08-06
tags: ['!!', Kotlin, Not-Null Assertion Operator]

---

---
lang: ja-jp
breaks: true
---
# Kotlin ビックリマーク二つ`!!`(Not-Null Assertion Operator) の意味 2021-08-06

## C#の`.Value`と同じ意味

> Not-Null Assertion Operator
> https://engawapg.net/kotlin/116/

```kotlin=
val str: String? = "test"
val len = str!!.length     // 4
```

```kotlin=
val str: String? = null
val len = str!!.length     // NullPointerException
```

###### tags: `Kotlin` `!!` `Not-Null Assertion Operator`
