Add reverse() function to js version of StringBuilder

This commit is contained in:
Ilya Ryzhenkov
2014-03-21 19:20:07 +04:00
committed by Andrey Breslav
parent 962a738f1e
commit aee199b5b0
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -51,5 +51,6 @@ public class StringBuilder() : Appendable {
//TODO
//override fun append(csq: CharSequence?, start: Int, end: Int): StringBuilder = js.noImpl
public fun append(obj: Any?): StringBuilder = js.noImpl
public fun reverse(): StringBuilder = js.noImpl
override fun toString(): String = js.noImpl
}
+4
View File
@@ -603,6 +603,10 @@
this.string = this.string + obj.toString();
return this;
},
reverse: function () {
this.string = this.string.split("").reverse().join("");
return this;
},
toString: function () {
return this.string;
}