Skip to content

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.

Notifications You must be signed in to change notification settings

wellitongervickas/javascript-sprintf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published