StringBuilder builder and appendln

This commit is contained in:
Ilya Ryzhenkov
2014-06-05 23:20:39 +04:00
committed by Andrey Breslav
parent 0717511abe
commit 516bae17d7
11 changed files with 160 additions and 9 deletions
+9 -2
View File
@@ -649,8 +649,15 @@
function () {
this.string = "";
}, {
append: function (obj) {
this.string = this.string + obj.toString();
append: function (obj, from, to) {
if (from == undefined && to == undefined) {
this.string = this.string + obj.toString();
} else if (to == undefined) {
this.string = this.string + obj.toString().substring(from);
} else {
this.string = this.string + obj.toString().substring(from, to);
}
return this;
},
reverse: function () {