You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Kotlin/JVM inserts the "null" string if the argument is null.
325
324
val toInsert = value ?:"null"
@@ -386,8 +385,8 @@ actual class StringBuilder private constructor (
386
385
*
387
386
* @throws IndexOutOfBoundsException if [startIndex] is less than zero or greater than the length of this string builder.
388
387
*/
389
-
@SinceKotlin("1.3")
390
-
@ExperimentalStdlibApi
388
+
@SinceKotlin("1.4")
389
+
@WasExperimental(ExperimentalStdlibApi::class)
391
390
actualfunsubstring(startIndex:Int): String {
392
391
return substring(startIndex, _length)
393
392
}
@@ -425,8 +424,8 @@ actual class StringBuilder private constructor (
425
424
*
426
425
* @throws IndexOutOfBoundsException or [IllegalArgumentException] if [startIndex] is less than zero, greater than the length of this string builder, or `startIndex > endIndex`.
@@ -450,8 +449,8 @@ actual class StringBuilder private constructor (
450
449
*
451
450
* @throws IndexOutOfBoundsException if [index] is out of bounds of this string builder.
452
451
*/
453
-
@SinceKotlin("1.3")
454
-
@ExperimentalStdlibApi
452
+
@SinceKotlin("1.4")
453
+
@WasExperimental(ExperimentalStdlibApi::class)
455
454
fundeleteAt(index:Int): StringBuilder {
456
455
checkIndex(index)
457
456
array.copyInto(array, startIndex = index +1, endIndex =_length, destinationOffset = index)
@@ -467,8 +466,8 @@ actual class StringBuilder private constructor (
467
466
*
468
467
* @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] is out of range of this string builder indices or when `startIndex > endIndex`.
@@ -510,8 +509,8 @@ actual class StringBuilder private constructor (
510
509
*
511
510
* @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] array indices or when `startIndex > endIndex`.
@@ -524,28 +523,25 @@ actual class StringBuilder private constructor (
524
523
/**
525
524
* Appends a subsequence of the specified character sequence [value] to this string builder and returns this instance.
526
525
*
527
-
* @param value the character sequence from which a subsequence is appended. If [value] is `null`,
528
-
* then characters are appended as if [value] contained the four characters `"null"`.
526
+
* @param value the character sequence from which a subsequence is appended.
529
527
* @param startIndex the beginning (inclusive) of the subsequence to append.
530
528
* @param endIndex the end (exclusive) of the subsequence to append.
531
529
*
532
530
* @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] character sequence indices or when `startIndex > endIndex`.
@@ -555,20 +551,17 @@ actual class StringBuilder private constructor (
555
551
* The inserted characters go in the same order as in the [value] character sequence, starting at [index].
556
552
*
557
553
* @param index the position in this string builder to insert at.
558
-
* @param value the character sequence from which a subsequence is inserted. If [value] is `null`,
559
-
* then characters will be inserted as if [value] contained the four characters `"null"`.
554
+
* @param value the character sequence from which a subsequence is inserted.
560
555
* @param startIndex the beginning (inclusive) of the subsequence to insert.
561
556
* @param endIndex the end (exclusive) of the subsequence to insert.
562
557
*
563
558
* @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] character sequence indices or when `startIndex > endIndex`.
564
559
* @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
@@ -577,7 +570,7 @@ actual class StringBuilder private constructor (
577
570
var from = startIndex
578
571
var to = index
579
572
while (from < endIndex) {
580
-
array[to++] =toInsert[from++]
573
+
array[to++] =value[from++]
581
574
}
582
575
583
576
_length+= extraLength
@@ -597,8 +590,8 @@ actual class StringBuilder private constructor (
597
590
* @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] array indices or when `startIndex > endIndex`.
598
591
* @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
@@ -665,8 +658,8 @@ public actual inline operator fun StringBuilder.set(index: Int, value: Char): Un
665
658
*
666
659
* @throws IndexOutOfBoundsException or [IllegalArgumentException] if [startIndex] is less than zero, greater than the length of this string builder, or `startIndex > endIndex`.
@@ -695,8 +688,8 @@ public actual inline fun StringBuilder.deleteAt(index: Int): StringBuilder = thi
695
688
*
696
689
* @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this string builder indices or when `startIndex > endIndex`.
@@ -731,8 +724,8 @@ public actual inline fun StringBuilder.toCharArray(destination: CharArray, desti
731
724
*
732
725
* @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] array indices or when `startIndex > endIndex`.
@@ -741,18 +734,17 @@ public actual inline fun StringBuilder.appendRange(value: CharArray, startIndex:
741
734
/**
742
735
* Appends a subsequence of the specified character sequence [value] to this string builder and returns this instance.
743
736
*
744
-
* @param value the character sequence from which a subsequence is appended. If [value] is `null`,
745
-
* then characters are appended as if [value] contained the four characters `"null"`.
737
+
* @param value the character sequence from which a subsequence is appended.
746
738
* @param startIndex the beginning (inclusive) of the subsequence to append.
747
739
* @param endIndex the end (exclusive) of the subsequence to append.
748
740
*
749
741
* @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] character sequence indices or when `startIndex > endIndex`.
@@ -768,8 +760,8 @@ public actual inline fun StringBuilder.appendRange(value: CharSequence?, startIn
768
760
* @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] array indices or when `startIndex > endIndex`.
769
761
* @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
@@ -781,19 +773,18 @@ public actual inline fun StringBuilder.insertRange(index: Int, value: CharArray,
781
773
* The inserted characters go in the same order as in the [value] character sequence, starting at [index].
782
774
*
783
775
* @param index the position in this string builder to insert at.
784
-
* @param value the character sequence from which a subsequence is inserted. If [value] is `null`,
785
-
* then characters will be inserted as if [value] contained the four characters `"null"`.
776
+
* @param value the character sequence from which a subsequence is inserted.
786
777
* @param startIndex the beginning (inclusive) of the subsequence to insert.
787
778
* @param endIndex the end (exclusive) of the subsequence to insert.
788
779
*
789
780
* @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] character sequence indices or when `startIndex > endIndex`.
790
781
* @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
@@ -887,10 +878,14 @@ public inline fun StringBuilder.setLength(l: Int) = this.setLength(newLength = l
887
878
* @throws IndexOutOfBoundsException or [IllegalArgumentException] when [start] or [end] is out of range of the [csq] character sequence indices or when `start > end`.
888
879
* @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.
0 commit comments