Simple JS string builder
npm install format-string-builderjavascript
var FormatStringBuilder = require("format-string-builder");
const Builder = new FormatStringBuilder();
`
Functions
$3
Sets the string and new line delimiter. If none are supplied, uses empty string and "\n" as delimiter.
`javascript
const Builder = new FormatStringBuilder("Test string");
`
$3
Appends the given string to builder.
`javascript
Builder.append("I forgot this part");
`
$3
Appends the given string to builder with a newline.
`javascript
Builder.appendLn("I am followed by a new line");
`
$3
Replaces placeholders with given arguments.
`javascript
Builder.format("Hello {0}, my name is {1} {2}", "reader", "Uncle", "Bob");
`
The string is formatted as:
"Hello reader, my name is Uncle Bob"
$3
Clears the string.
`javascript
Builder.clear();
`
$3
Returns the built string.
`javascript
const builtString = Builder.toString();
``