UNPKG

js-function-lib

Version:

JavaScript function library

18 lines (17 loc) 417 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * 从string字符串中移除后面的空格 * * @param {string} string 要处理的字符串 * @returns {string} 返回处理后的字符串 * @version 1.1.5 * @example * * trimEnd(' 1 2 3 '); * // => ' 1 2 3' */ function trimEnd(string) { return string.replace(/\s+$/, ''); } exports.default = trimEnd;