# AlteredCharSequence

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  
Deprecated in[API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# AlteredCharSequence

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/text/AlteredCharSequence "View this page in Java")  

```
open class AlteredCharSequence : CharSequence, GetChars
```

|---|----------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                       ||
| ↳ | [android.text.AlteredCharSequence](https://developer.android.com/reference/kotlin/android/text/AlteredCharSequence#) |

*** ** * ** ***

| **This class was deprecated in API level 30.**
|
| The functionality this class offers is easily implemented outside the framework.

An AlteredCharSequence is a CharSequence that is largely mirrored from another CharSequence, except that a specified range of characters are mirrored from a different char array instead.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                  Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                  ||
|--------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Char](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char/index.html)                                   | [get](https://developer.android.com/reference/kotlin/android/text/AlteredCharSequence#get(kotlin.Int))`(`off:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                   | [getChars](https://developer.android.com/reference/kotlin/android/text/AlteredCharSequence#getChars(kotlin.Int,%20kotlin.Int,%20kotlin.CharArray,%20kotlin.Int))`(`start:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `end:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `dest:` `[CharArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-array/index.html)!`, `off:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />                                                                                                                                                                                                                                               |
| openstatic[AlteredCharSequence](https://developer.android.com/reference/kotlin/android/text/AlteredCharSequence#)! | [make](https://developer.android.com/reference/kotlin/android/text/AlteredCharSequence#make(kotlin.CharSequence,%20kotlin.CharArray,%20kotlin.Int,%20kotlin.Int))`(`source:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`, `sub:` `[CharArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-array/index.html)!`, `substart:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `subend:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Create an AlteredCharSequence whose text (and possibly spans) are mirrored from`source`, except that the range of offsets`substart`inclusive to`subend`exclusive are mirrored instead from`sub`, beginning at offset 0. |
| open[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)                  | [subSequence](https://developer.android.com/reference/kotlin/android/text/AlteredCharSequence#subSequence(kotlin.Int,%20kotlin.Int))`(`startIndex:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `endIndex:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| open[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                               | [toString](https://developer.android.com/reference/kotlin/android/text/AlteredCharSequence#toString())`()` <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

|                                                                                             Properties                                                                                             ||
|--------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
| open[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [length](https://developer.android.com/reference/kotlin/android/text/AlteredCharSequence#length:kotlin.Int) <br /> |

## Public methods

### get

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun get(off: Int): Char
```

**Deprecated:** *Deprecated in Java.*

|                     Parameters                      ||
|---------|--------------------------------------------|
| `index` | the index of the`char`value to be returned |

|                                                 Return                                                 ||
|------------------------------------------------------------------------------|--------------------------|
| [Char](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char/index.html) | the specified`char`value |

|                                             Exceptions                                              ||
|---------------------------------------|--------------------------------------------------------------|
| `java.lang.IndexOutOfBoundsException` | if the`index`argument is negative or not less than`length()` |

### getChars

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

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

**Deprecated:** *Deprecated in Java.*  

### make

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open static fun make(
    source: CharSequence!, 
    sub: CharArray!, 
    substart: Int, 
    subend: Int
): AlteredCharSequence!
```

**Deprecated:** *Deprecated in Java.*

Create an AlteredCharSequence whose text (and possibly spans) are mirrored from`source`, except that the range of offsets`substart`inclusive to`subend`exclusive are mirrored instead from`sub`, beginning at offset 0.  

### subSequence

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun subSequence(
    startIndex: Int, 
    endIndex: Int
): CharSequence
```

**Deprecated:** *Deprecated in Java.*

|             Parameters              ||
|---------|----------------------------|
| `start` | the start index, inclusive |
| `end`   | the end index, exclusive   |

|                                                          Return                                                          ||
|-----------------------------------------------------------------------------------------------|---------------------------|
| [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html) | 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

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun toString(): String
```

**Deprecated:** *Deprecated in Java.*

|                                                                    Return                                                                    ||
|----------------------------------------------------------------------------------|------------------------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string consisting of exactly this sequence of characters |

## Properties

### length

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open val length: Int
```

|                                                      Return                                                       ||
|----------------------------------------------------------------------------|---------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the number of`char`s in this sequence |