Format a template with placeholder values.
Numeric.string.mod(template, values)Substitutes placeholders in the template string.
- Parameters:
template: Template string or array of templatesvalues: Replacement values for the template placeholders
- Returns: Formatted strings matching the input shape
- NumPy: Covers
np.strings.mod,np.char.modthrough a single Numerix method.
import Numeric from '@neabyte/numerix'
const value = Numeric.string.mod('Hi %s', 'Bob')
console.log(value)
// Hi Bobimport Numeric from '@neabyte/numerix'
const value = Numeric.string.mod('%d items', 5)
console.log(value)
// 5 itemsimport Numeric from '@neabyte/numerix'
const value = Numeric.string.mod('plain', 'Bob')
console.log(value)
// plainimport Numeric from '@neabyte/numerix'
const values = Numeric.string.mod(['%s', '%s'], ['a', 'b'])
console.log(values)
// ["a","b"]