UNPKG

@c_s_v_s_subrahmanyam/string-utils

Version:

A comprehensive utility library for advanced string operations.

7 lines (5 loc) 256 B
// Prefix and Suffix Utilities module.exports = { removePrefix: (str, prefix) => (str.startsWith(prefix) ? str.slice(prefix.length) : str), removeSuffix: (str, suffix) => (str.endsWith(suffix) ? str.slice(0, -suffix.length) : str), };