utilizes.prefix
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i utilizes.prefix

Weekly Downloads

1

Version

1.2.1

License

MIT

Unpacked Size

54.8 kB

Total Files

5

Last publish

Collaborators

  • natqe3