• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1interface String {
2    /**
3     * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.
4     * The padding is applied from the start (left) of the current string.
5     *
6     * @param maxLength The length of the resulting string once the current string has been padded.
7     *        If this parameter is smaller than the current string's length, the current string will be returned as it is.
8     *
9     * @param fillString The string to pad the current string with.
10     *        If this string is too long, it will be truncated and the left-most part will be applied.
11     *        The default value for this parameter is " " (U+0020).
12     */
13    padStart(maxLength: number, fillString?: string): string;
14
15    /**
16     * Pads the current string with a given string (possibly repeated) so that the resulting string reaches a given length.
17     * The padding is applied from the end (right) of the current string.
18     *
19     * @param maxLength The length of the resulting string once the current string has been padded.
20     *        If this parameter is smaller than the current string's length, the current string will be returned as it is.
21     *
22     * @param fillString The string to pad the current string with.
23     *        If this string is too long, it will be truncated and the left-most part will be applied.
24     *        The default value for this parameter is " " (U+0020).
25     */
26    padEnd(maxLength: number, fillString?: string): string;
27}
28