esamattis / esamattis/underscore.string
Add .NET like string formatting
- Dominant language
- JavaScript
- Stars
- 3.4k
- Forks
- 367
- PR merge metrics
- No merged PRs in 30d
Description
The sprintf formatting is useful when you want to specify how the particular value should be formatted in the string, like decimal places, zero padding etc. However, if you work with localized format strings, you'll need changing order of the parameter placeholders to be different than the order of the values pass in to the formatting function. You may also need placing the same value multiple times by repeating the same parameter placeholder.
Basically, the formatting can use `{N}` placeholders, when _N_ is the index of the parameter in the argument list. For example:
``` javascript
_.sformat("See also: {0} (page {1})", "Architecture", 10)
"See also: Architecture (page 10)"
```
Contributor guide
Assessment
This issue has not been assessed yet.