source: node_modules/es-toolkit/dist/compat/string/trim.d.mts

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[a762898]1/**
2 * Removes leading and trailing whitespace or specified characters from a string.
3 *
4 * @param {string} str - The string from which leading and trailing characters will be trimmed.
5 * @param {string | string[]} chars - The character(s) to remove from the end of the string. Defaults to `" "`.
6 * @returns {string} - The resulting string after the specified leading and trailing characters have been removed.
7 *
8 * @example
9 * trim(" hello "); // "hello"
10 * trim("--hello--", "-"); // "hello"
11 * trim("##hello##", ["#", "o"]); // "hell"
12 */
13declare function trim(string?: string, chars?: string): string;
14/**
15 * Removes leading and trailing whitespace or specified characters from a string.
16 *
17 * @param {string} str - The string from which leading and trailing characters will be trimmed.
18 * @param {string | string[]} chars - The character(s) to remove from the end of the string. Defaults to `" "`.
19 * @returns {string} - The resulting string after the specified leading and trailing characters have been removed.
20 *
21 * @example
22 * trim(" hello "); // "hello"
23 * trim("--hello--", "-"); // "hello"
24 * trim("##hello##", ["#", "o"]); // "hell"
25 */
26declare function trim(string: string, index: string | number, guard: object): string;
27
28export { trim };
Note: See TracBrowser for help on using the repository browser.