We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a76a8fc commit 3bb8cf1Copy full SHA for 3bb8cf1
libraries/stdlib/src/kotlin/text/Strings.kt
@@ -191,6 +191,15 @@ public val String.indices: IntRange
191
public val String.lastIndex: Int
192
get() = this.length() - 1
193
194
+/**
195
+ * Returns a character at the given index in a [CharSequence]. Allows to use the
196
+ * index operator for working with character sequences:
197
+ * ```
198
+ * val c = charSequence[5]
199
200
+ */
201
+public operator fun CharSequence.get(index: Int): Char = this.get(index)
202
+
203
/**
204
* Returns `true` if this CharSequence has Unicode surrogate pair at the specified [index].
205
*/
0 commit comments