str-render
v0.0.2
Published
Replace a string by multiple strings
Downloads
5
Maintainers
Readme
Installation
npm install str-render
Usage
This is wrote following the OADS Standards.
strRender("template","replaced",..."['replacers']") => "renderedString"
Replaces a string by multiple string in ordered way.
- "template": The original string.
- "replaced": The string you want to be replaced.
- ..."['replacers']": The replacers strings.
Eg:
var strRender = require('str-render');
var greeting = "Hello %s, I'm %s";
var str = strRender(greeting, '%s','Mickey','Minnie');
// str: Hello Mickey, I'm Minnie