---
title: "takeOrElse"
description: "If [isSpecified] is true then this is returned, otherwise [block] is executed and its result is
returned."
type: "function"
---

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


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


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


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



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


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


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



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


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


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



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


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


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



