UNPKG

t-comm

Version:

专业、稳定、纯粹的工具库

45 lines (44 loc) 819 B
/** * 移除第一个反斜杠 * * @export * @param {string} [str=''] 输入字符串 * @returns {string} 字符串 * @example * ```ts * removeFirstSlash('/abc/ddd/') * * 'abc/ddd/' * ``` */ export declare function removeFirstSlash(str?: string): string; /** * 移除最后一个反斜杠 * * @export * @param {string} [str=''] 输入字符串 * @returns {string} 字符串 * * @example * ```ts * removeLastSlash('/abc/') * * '/abc' * ``` */ export declare function removeLastSlash(str?: string): string; /** *移除第一个和最后一个反斜杠 * * @export * @param {string} [str=''] 输入字符串 * @returns {string} 字符串 * * @example * ```ts * removeFirstAndLastSlash('/abc/') * * 'abc' * ``` */ export declare function removeFirstAndLastSlash(str?: string): string;