UNPKG

everyutil

Version:

A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.

13 lines (12 loc) 477 B
/** * Centers text in a given width, using a specified fill character. * * Example: centerText("hi", 5, "-") → "--hi-" * * @author @dailker * @param {string} str - The input string. * @param {number} width - The total width of the resulting string. * @param {string} [fillChar=" "] - The character to use for padding. * @returns {string} The centered string. */ export declare function centerText(str: string, width: number, fillChar?: string): string;