Add reverse() function to js version of StringBuilder
This commit is contained in:
committed by
Andrey Breslav
parent
962a738f1e
commit
aee199b5b0
@@ -51,5 +51,6 @@ public class StringBuilder() : Appendable {
|
|||||||
//TODO
|
//TODO
|
||||||
//override fun append(csq: CharSequence?, start: Int, end: Int): StringBuilder = js.noImpl
|
//override fun append(csq: CharSequence?, start: Int, end: Int): StringBuilder = js.noImpl
|
||||||
public fun append(obj: Any?): StringBuilder = js.noImpl
|
public fun append(obj: Any?): StringBuilder = js.noImpl
|
||||||
|
public fun reverse(): StringBuilder = js.noImpl
|
||||||
override fun toString(): String = js.noImpl
|
override fun toString(): String = js.noImpl
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -603,6 +603,10 @@
|
|||||||
this.string = this.string + obj.toString();
|
this.string = this.string + obj.toString();
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
reverse: function () {
|
||||||
|
this.string = this.string.split("").reverse().join("");
|
||||||
|
return this;
|
||||||
|
},
|
||||||
toString: function () {
|
toString: function () {
|
||||||
return this.string;
|
return this.string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user