How to use stringbuilder in angular2

I am doing an angular2 application and there I have to use StringBuilder. So I have to know How to use the string builder and how to append to it.

var sb = new StringBuilder();
var sResult = "";
$(arrayWidgets).each(function (index) { if (arrayWidgets[index] != "") { sb.append("<div class='EachWidget FL'>"); sb.append("</div>"); }
});

This is the code in Javascript

StringBuilder Code

var StringBuilder = function () { this.value = ""; };
StringBuilder.prototype.append = function (value) { this.value += value; };
StringBuilder.prototype.toString = function () { return this.value; };
2 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like