ensureRight
Ensures a string ends with a given suffix.
ensureRight
Signature
typescript
function ensureRight(str: string, suffix: string): stringParameters
str- The string to checksuffix- The suffix to ensure
Returns
String with suffix guaranteed.
Examples
typescript
import { ensureRight } from 'strio'
ensureRight('hello', '!')
// "hello!"
ensureRight('hello!', '!')
// "hello!"Related Functions
- ensureLeft - Ensure prefix