/******************************************************************** * @author: Kaven * @email: kaven@wuwenkai.com * @website: http://blog.kaven.xyz * @file: [Kaven-Basic] /src/libs/string/ReplaceAll.ts * @create: 2025-06-25 15:55:04.109 * @modify: 2025-07-11 21:19:12.845 * @version: 6.0.0 * @times: 6 * @lines: 96 * @copyright: Copyright © 2018-2025 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. ********************************************************************/ /** * Replaces all occurrences of a target substring within the input string with a replacement string. * * @param input - The original string to perform replacements on. * @param target - The substring to search for within the input string. * @param replacement - The string to replace each occurrence of the target substring. * @returns A new string with all occurrences of the target substring replaced by the replacement string. * * @since 4.0.0 * @version 2025-07-09 */ export declare function ReplaceAll(input: string, target: string, replacement: string): string; /** * Replaces all occurrences of each target substring in the input string with the specified replacement string. * * @param input - The original string to perform replacements on. * @param target - An array of substrings to be replaced in the input string. * @param replacement - The string to replace each occurrence of the target substrings. * @returns A new string with all target substrings replaced by the replacement string. * * @since 4.0.0 * @version 2025-07-09 */ export declare function ReplaceAll(input: string, target: string[], replacement: string): string; /** * Replaces all occurrences of specified target substrings in the input string with their corresponding replacements. * * @param input - The original string to perform replacements on. * @param target - An array of substrings to be replaced in the input string. * @param replacement - An array of replacement strings corresponding to each target substring. * @returns A new string with all specified targets replaced by their replacements. * * @remarks * The `target` and `replacement` arrays should have the same length. Each occurrence of `target[i]` in the input will be replaced with `replacement[i]`. * * @since 4.0.0 * @version 2025-07-09 */ export declare function ReplaceAll(input: string, target: string[], replacement: string[]): string; //# sourceMappingURL=ReplaceAll.d.ts.map