@technobuddha > library > String > Construction
Function: ensurePrefix()
ts
function ensurePrefix(input: string, prefix: string): string;Defined in: ensure-prefix.ts:9
Add a prefix to a string, if it does not already have the prefix
Parameters
| Parameter | Type | Description |
|---|---|---|
input | string | The string |
prefix | string | The prefix |
Returns
string
The prefix followed by the string