<div class='type'>Function</div>


<a id='references'></a>


<h2 id="takeorelse-block">takeOrElse</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline fun TextUnit.takeOrElse(block: () -> TextUnit): TextUnit
```


If this `TextUnit` `isSpecified` then this is returned, otherwise `block` is executed and its
result is returned.





<hr class="docs-overload-divider">


<h2 id="takeorelse-block-2">takeOrElse</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline fun Dp.takeOrElse(block: () -> Dp): Dp
```


If this `Dp` `isSpecified` then this is returned, otherwise `block` is executed and its result is
returned.





<hr class="docs-overload-divider">


<h2 id="takeorelse-block-3">takeOrElse</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline fun DpOffset.takeOrElse(block: () -> DpOffset): DpOffset
```


If this `DpOffset`&nbsp;`isSpecified` then this is returned, otherwise `block` is executed and
its result is returned.





<hr class="docs-overload-divider">


<h2 id="takeorelse-block-4">takeOrElse</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
inline fun DpSize.takeOrElse(block: () -> DpSize): DpSize
```


If this `DpSize`&nbsp;`isSpecified` then this is returned, otherwise `block` is executed and its
result is returned.