@yookue/ts-lang-utils
    Preparing search index...

    Function rightPad

    • Returns the right padded string with the given size and string, or original string if no padding is necessary

      Parameters

      • Optionaltext: null | string

        the source string to inspect

      • Optionalsize: number

        the size to pad to

      • Optionalpad: null | string

        the target string to fill, default is space

      Returns undefined | null | string

      the right padded string with the given size and string, or original string if no padding is necessary

      David Hsing

      rightPad(undefined, -1, null);    // undefined
      rightPad('', 3, 'z'); // 'zzz'
      rightPad('foo', 3, 'z'); // 'foo'
      rightPad('foo', 8, 'yz') = 'fooyzyzy'