# SpannedStringKt

Added in 1.1.0

*** ** * ** ***


```
public final class SpannedStringKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull T[]` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/core/text/SpannedStringKt#(android.text.Spanned).getSpans(kotlin.Int,kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/text/Spanned.html receiver, int start, int end)` Get all spans that are instance of `https://developer.android.com/reference/androidx/core/text/package-summary#(android.text.Spanned).getSpans(kotlin.Int,kotlin.Int)`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/text/Spanned.html` | `https://developer.android.com/reference/androidx/core/text/SpannedStringKt#(kotlin.CharSequence).toSpanned()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/CharSequence.html receiver)` Returns a new `https://developer.android.com/reference/android/text/Spanned.html` from `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html`, or the source itself if it is already an instance of `https://developer.android.com/reference/android/text/SpannedString.html`. |

## Public methods

### getSpans

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/text/SpannedString.kt+function:getSpans)

```
public static final @NonNull T[] <T extends Object> getSpans(@NonNull Spanned receiver, int start, int end)
```

Get all spans that are instance of `https://developer.android.com/reference/androidx/core/text/package-summary#(android.text.Spanned).getSpans(kotlin.Int,kotlin.Int)`.

### toSpanned

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/text/SpannedString.kt+function:toSpanned) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Spanned toSpanned(@NonNull CharSequence receiver)
```

Returns a new `https://developer.android.com/reference/android/text/Spanned.html` from `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html`, or the source itself if it is already an instance of `https://developer.android.com/reference/android/text/SpannedString.html`.