sprintf

Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.string

Javascript implementation of the sprintf php function. >For more infos, check this github repository

Params

  1. format*-String

    The format of the string wanted as output

  2. …replacements*-Mixed

    The replacement tokens to apply to the string

Return

  1. -String

    The processed string

Example

import { sprintf } from '@blackbyte/sugar/string'
sprintf('Hello %s', 'world') // Hello World
const user = { name: 'Dolly' }
sprintf('Hello %(name)s', user) // Hello Dolly

Todo

  • testsnormal