Package Exports
- strbuilder
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (strbuilder) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
stringbuilder
Simple-to-the-task string builder utility.
Installation
npm install strbuilderTest
npm testUsage in Node
/* With initialization text */
var sb = require('strbuilder')("Start text");
/* Or no text initialization. */
var sb1 = require('strbuilder')();
sb.append("Hello,").append(" world!");
console.log(sb.toString()) /* prints 'Hello, world!' */
console.log(sb.length) /* prints 2.
Usage in Browser
<!-- include it at the head section of your page -->
<script src='path/to/stringbuilder.js'></script>
/* With initialization text */
var sb = stringbuilder("Start text");
/* Or no text initialization. */
var sb1 = stringbuilder();
sb.append("Hello,").append(" world!");
console.log(sb.toString()) /* prints 'Hello, world!' */
console.log(sb.length) /* prints 2.
Property and methods
length:tells us the number of different string appended to it.toString:returns all the strings in it, joined together.append:adds a string to the string builder.
Thanks all.