Google is committed to advancing racial equity for Black communities. See how.
Added in API level 1

SpannedString

class SpannedString : CharSequence, GetChars, Spanned
kotlin.Any
   ↳ android.text.SpannedString

This is the class for text whose content and markup are immutable. For mutable markup, see SpannableString; for mutable text, see SpannableStringBuilder.

Summary

Inherited constants
Public constructors
<init>(source: CharSequence!)

For the backward compatibility reasons, this constructor copies all spans including .

Public methods
Boolean
equals(other: Any?)

Char
get(i: Int)

Unit
getChars(start: Int, end: Int, dest: CharArray!, off: Int)

Int
getSpanEnd(what: Any!)

Int
getSpanFlags(what: Any!)

Int
getSpanStart(what: Any!)

Array<T>!
getSpans(queryStart: Int, queryEnd: Int, kind: Class<T>!)

Int

Int
nextSpanTransition(start: Int, limit: Int, kind: Class<Any!>!)

CharSequence
subSequence(startIndex: Int, endIndex: Int)

String

static SpannedString!

Properties
Int

Public constructors

<init>

Added in API level 1
SpannedString(source: CharSequence!)

For the backward compatibility reasons, this constructor copies all spans including .

Parameters
source CharSequence!: source text

Public methods

equals

fun equals(other: Any?): Boolean

get

fun get(i: Int): Char

getChars

fun getChars(
    start: Int,
    end: Int,
    dest: CharArray!,
    off: Int
): Unit

getSpanEnd

fun getSpanEnd(what: Any!): Int

getSpanFlags

fun getSpanFlags(what: Any!): Int

getSpanStart

fun getSpanStart(what: Any!): Int

getSpans

fun <T : Any!> getSpans(
    queryStart: Int,
    queryEnd: Int,
    kind: Class<T>!
): Array<T>!

hashCode

fun hashCode(): Int

nextSpanTransition

fun nextSpanTransition(
    start: Int,
    limit: Int,
    kind: Class<Any!>!
): Int

subSequence

Added in API level 1
fun subSequence(
    startIndex: Int,
    endIndex: Int
): CharSequence
Parameters
start the start index, inclusive
end the end index, exclusive
Return
CharSequence the specified subsequence
Exceptions
java.lang.IndexOutOfBoundsException if start or end are negative, if end is greater than length(), or if start is greater than end

toString

fun toString(): String

valueOf

Added in API level 1
static fun valueOf(source: CharSequence!): SpannedString!

Properties

length

val length: Int