Stay organized with collections
Save and categorize content based on your preferences.
GetChars
interface GetChars : CharSequence
Known Direct Subclasses
AlteredCharSequence |
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.
|
Editable |
This is the interface for text whose content and markup can be changed (as opposed to immutable text like Strings).
|
SpannableString |
This is the class for text whose content is immutable but to which markup objects can be attached and detached.
|
SpannableStringBuilder |
This is the class for text whose content and markup can both be changed.
|
SpannedString |
This is the class for text whose content and markup are immutable.
|
|
Known Indirect Subclasses
|
Please implement this interface if your CharSequence has a getChars() method like the one in String that is faster than calling charAt() multiple times.
Summary
Public methods |
abstract Unit |
Exactly like String.
|
Public methods
getChars
abstract fun getChars(
start: Int,
end: Int,
dest: CharArray!,
destoff: Int
): Unit
Exactly like String.getChars(): copy chars start
through end - 1
from this CharSequence into dest
beginning at offset destoff
.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# GetChars\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nGetChars\n========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/text/GetChars \"View this page in Java\") \n\n```\ninterface GetChars : CharSequence\n```\n\n|----------------------------|\n| [android.text.GetChars](#) |\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [AlteredCharSequence](/reference/kotlin/android/text/AlteredCharSequence), [Editable](/reference/kotlin/android/text/Editable), [SpannableString](/reference/kotlin/android/text/SpannableString), [SpannableStringBuilder](/reference/kotlin/android/text/SpannableStringBuilder), [SpannedString](/reference/kotlin/android/text/SpannedString) |---------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [AlteredCharSequence](/reference/kotlin/android/text/AlteredCharSequence) | 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. | | [Editable](/reference/kotlin/android/text/Editable) | This is the interface for text whose content and markup can be changed (as opposed to immutable text like Strings). | | [SpannableString](/reference/kotlin/android/text/SpannableString) | This is the class for text whose content is immutable but to which markup objects can be attached and detached. | | [SpannableStringBuilder](/reference/kotlin/android/text/SpannableStringBuilder) | This is the class for text whose content and markup can both be changed. | | [SpannedString](/reference/kotlin/android/text/SpannedString) | This is the class for text whose content and markup are immutable. | |\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Indirect Subclasses [SpannableStringBuilder](/reference/kotlin/android/text/SpannableStringBuilder) |---------------------------------------------------------------------------------|--------------------------------------------------------------------------| | [SpannableStringBuilder](/reference/kotlin/android/text/SpannableStringBuilder) | This is the class for text whose content and markup can both be changed. | |\n\nPlease implement this interface if your CharSequence has a getChars() method like the one in String that is faster than calling charAt() multiple times.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [getChars](#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)!`, `destoff:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Exactly like String. |\n\nPublic methods\n--------------\n\n### getChars\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getChars(\n start: Int, \n end: Int, \n dest: CharArray!, \n destoff: Int\n): Unit\n```\n\nExactly like String.getChars(): copy chars `start` through `end - 1` from this CharSequence into `dest` beginning at offset `destoff`."]]