/******************************************************************** * @author: Kaven * @email: kaven@wuwenkai.com * @website: http://blog.kaven.xyz * @file: [Kaven-Basic] /src/libs/string/TrimEnd.ts * @create: 2025-06-25 17:13:31.085 * @modify: 2026-03-12 14:05:18.535 * @version: 6.1.1 * @times: 11 * @lines: 126 * @copyright: Copyright © 2018-2026 Kaven. All Rights Reserved. * @description: [description] * @license: * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. ********************************************************************/ /** * Removes the specified target substring from the end of the input string, if present. * * @param input - The original string to trim. * @param target - The substring to remove from the end of the input string. * @returns The trimmed string with the target removed from the end, if it was present. * * @remarks This function will remove all occurrences of the target substring from the end until it no longer ends with the target. * * @since 3.0.3 * @version 2025-06-25 */ export declare function TrimEnd(input: string, target: string): string; /** * Removes up to a specified number of occurrences of a target substring from the end of the input string. * * @param input - The original string to trim. * @param target - The substring to remove from the end of the input. * @param max - The maximum number of times to remove the target substring. * @returns The trimmed string with up to `max` occurrences of `target` removed from the end. * * @since 3.0.3 * @version 2025-06-25 */ export declare function TrimEnd(input: string, target: string, max: number): string; /** * Removes all occurrences of the specified target substrings from the end of the input string. * * @param input - The original string to trim. * @param targets - An array of substrings to remove from the end of the input string. * @returns The trimmed string with all specified target substrings removed from the end. * * @remarks This function will repeatedly trim all occurrences of the target substrings from the end until no more can be trimmed. * * @since 3.0.3 * @version 2025-06-25 */ export declare function TrimEnd(input: string, targets: string[]): string; /** * Removes specified target substrings from the end of the input string. * * @param input - The string to trim. * @param targets - An array of substrings to remove from the end of the input. * @param trimAll - If true, repeatedly trims all occurrences of the target substrings from the end; if false, trims only one occurrence. * @returns The trimmed string. * * @since 3.0.3 * @version 2026-03-12 */ export declare function TrimEnd(input: string, targets: string[], trimAll: boolean): string; //# sourceMappingURL=TrimEnd.d.ts.map