https://github.com/wellitongervickas/javascript-sprintf
This function is like a sprintf of php. You'll need to pass a string with "%s" and array/string of string(s) to replace.
https://github.com/wellitongervickas/javascript-sprintf
ecmascript helper javascript php sprintf
Last synced: 9 months ago
JSON representation
This function is like a sprintf of php. You'll need to pass a string with "%s" and array/string of string(s) to replace.
- Host: GitHub
- URL: https://github.com/wellitongervickas/javascript-sprintf
- Owner: wellitongervickas
- Created: 2018-10-05T00:04:17.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-08T16:37:02.000Z (about 7 years ago)
- Last Synced: 2024-08-10T10:10:37.160Z (over 1 year ago)
- Topics: ecmascript, helper, javascript, php, sprintf
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# javascript-sprintf
> Create a text dynamically using a function to convert "%s" to texts.
### Description
> This function is like a sprintf of php. You'll need to pass a string with "%s" and array/string of string(s) to replace.
#### Install
- npm install javascript-sprintf
- import sprintf from 'javascript-sprintf';
#### Example 1
> Input -> sprintf('My name is %s", 'foo');
> Output -> My name is foo
#### Example 2
> Input -> sprintf('My name is %s and your is %s", 'foo', 'bar')
> Output -> My name is foo and your is bar
[Npm](https://www.npmjs.com/package/javascript-sprintf)