@robertsspaceindustries/sub
v1.0.9
Published
String substitution
Downloads
2
Maintainers
Readme
@robertsspaceindustries/sub
Template string substition
Usage
import formatString from "@robertsspaceindustries/sub";
formatString("Lorem {{ipsum}}", {
ipsum: "Ipsum",
}); // Expected result: "Lorem Ipsum"
Custom delimiters
import formatString from "@robertsspaceindustries/sub";
formatString(
"Lorem {ipsum}",
{
ipsum: "Ipsum",
},
{
prefix: "{",
suffix: "}",
},
); // Expected result: "Lorem Ipsum"