String builder for JavaScript
출처 : https://www.c-sharpcorner.com/blogs/is-there-a-way-to-implement-a-stringbuilder-in-javascript2
String builder for JavaScript
function StringBuilder(value) {
this.strings = new Array();
this.append(value);
}
StringBuilder.prototype.append = function(value) {
if (value) {
this.strings.push(value);
}
}
StringBuilder.prototype.clear = function() {
this.strings.length = 0;
}
StringBuilder.prototype.toString = function() {
return this.strings.join("");
}
var sb = new StringBuilder();
sb.append("This is");
sb.append("much better looking");
sb.append("than using +=");
// joins the string
var myString = sb.toString();
// Cleans out the string buffer in the StringBuilder.
// This effectively makes it empty in case you did not
// know what cleaning out a buffer in this context
// meant.
sb.clear();
출처 : https://www.c-sharpcorner.com/blogs/is-there-a-way-to-implement-a-stringbuilder-in-javascript2
#테이블 변수사용의 예 use pubs go declare @tmptable table ( nid int identity(1,1) not null, title varchar (80) not null ) -- 테이블 변수 선언 inse...
댓글 없음:
댓글 쓰기