utilizes.prefix
v1.2.1
Published
Adding fix to beginning of string only if the string is present.
Downloads
5
Readme
prefix
Adding fix to beginning of string only if the string is present.
Usage: prefix(...args: string[]): string
import { prefix } from 'utilizes.prefix'
prefix('Mr ', 'john')
// Output: 'Mr john'
prefix('Mr ', null)
// Output: ''
prefix(null, 'john')
// Output: 'john'
prefix('Mr ', 'john', ' is', ' rich')
// Output: 'Mr john is rich'
prefix('Mr ', 'john', ' is ', undefined)
// Output: 'Mr john'
prefix('Mr ', 'john', null, ' rich')
// Output: 'Mr john rich'
This module exported from utilizes project.