rpad(string, length, fillChar) - pad string right to length filling with fillChar
511808
function (expr, length, fillChar) {
  fillChar = fillChar || ' ';
  var string = '' + expr;
  if (string.length > length) {
    return right(string, length);
  } else {
    while (string.length < length) {
      string = string + fillChar;
    }
  }
  return string;
}
1089669
function pad(value, length) {
  value = String(value);
  length = length || 2;

  while (value.length < length) {
    value = '0' + value;
  }

  return value;
}
1228759
public UTF8String rpad(int len, UTF8String pad) {
    int spaces = len - this.numChars(); // number of char need to pad
    if (spaces <= 0 || pad.numBytes() == 0) {
      // no padding at all, return the substring of the current string
      return substring(0, len);
    } else {
      int padChars = pad.numChars();
      int count = spaces / padChars; // how many padding string needed
      // the partial string of the padding
      UTF8String remain = pad.substring(0, spaces - padChars * count);

      byte[] data = new byte[this.numBytes + pad.numBytes * count + remain.numBytes];
      copyMemory(this.base, this.offset, data, BYTE_ARRAY_OFFSET, this.numBytes);
      int offset = this.numBytes;
      int idx = 0;
      while (idx < count) {
        copyMemory(pad.base, pad.offset, data, BYTE_ARRAY_OFFSET + offset, pad.numBytes);
        ++ idx;
        offset += pad.numBytes;
      }
      copyMemory(remain.base, remain.offset, data, BYTE_ARRAY_OFFSET + offset, remain.numBytes);

      return UTF8String.fromBytes(data);
    }
  }
677490
public static String pad (String value, int width, char c)
    {
        // sanity check
        if (width <= 0) {
            throw new IllegalArgumentException("Pad width must be greater than zero.");
        }
        int l = value.length();
        return (l >= width) ? value
                            : value + fill(c, width - l);
    }
603190
def _right_align(p_str):
    
    to_fill = _columns() - len(escape_ansi(p_str))

    if to_fill > 0:
        p_str = re.sub('\t', ' '*to_fill, p_str)
    else:
        p_str = re.sub('\t', ' ', p_str)

    return p_str
99059
public static String padRightAligned(String o, int len) {
    return o.length() >= len ? o : (whitespace(len - o.length()) + o);
  }
173064
function padRight(val, len, offset, char) {
    /* istanbul ignore if */
    if (!is_1.isValue(val) || !is_1.isString(val))
        return null;
    // If offset is a string
    // count its length.
    if (is_1.isString(offset))
        offset = offset.length;
    char = char || ' ';
    while (len--) {
        val += char;
    }
    if (offset)
        val += padRight('', offset, null, char);
    return val;
}
138709
private static function doPad(
        $string,
        $left,
        $right,
        $substring,
        $encoding = null
    ) {
        $strLength = Mbstring::strlen($string, $encoding);
        $padLength = Mbstring::strlen($substring, $encoding);
        $paddedLength = $strLength + $left + $right;

        if (!$padLength || $paddedLength <= $strLength) {
            return $string;
        }

        $leftStr = Mbstring::substr(str_repeat($substring, (int) ceil($left / $padLength)), 0, $left, $encoding);
        $rightStr = Mbstring::substr(str_repeat($substring, (int) ceil($right / $padLength)), 0, $right, $encoding);

        return $leftStr . $string . $rightStr;
    }
854268
def convert_pad(node, **kwargs):
    
    name, input_nodes, attrs = get_inputs(node, kwargs)

    mxnet_pad_width = convert_string_to_list(attrs.get("pad_width"))
    onnx_pad_width = transform_padding(mxnet_pad_width)

    pad_mode = attrs.get("mode")

    if pad_mode == "constant":
        pad_value = float(attrs.get("constant_value")) \
            if "constant_value" in attrs else 0.0
        node = onnx.helper.make_node(
            'Pad',
            inputs=input_nodes,
            outputs=[name],
            mode='constant',
            value=pad_value,
            pads=onnx_pad_width,
            name=name
        )
    else:
        node = onnx.helper.make_node(
            'Pad',
            inputs=input_nodes,
            outputs=[name],
            mode=pad_mode,
            pads=onnx_pad_width,
            name=name
        )

    return [node]
502697
final static public void spacePad(StringBuilder sbuf, int length) {
        while (length >= 32) {
            sbuf.append(SPACES[5]);
            length -= 32;
        }

        for (int i = 4; i >= 0; i--) {
            if ((length & (1 << i)) != 0) {
                sbuf.append(SPACES[i]);
            }
        }
    }
300064
public static function str_pad(&$str, int $pad_length, $pad_string=' ', int $pad_type=\STR_PAD_RIGHT) {
		cast::string($str, true);
		cast::string($pad_string, true);

		$current_length = v_mb::strlen($str);
		$pad_string_length = v_mb::strlen($pad_string);

		if ($pad_length <= $current_length || ! $pad_string_length) {
			return;
		}

		// Pad left.
		if (\STR_PAD_LEFT === $pad_type) {
			$str = \str_repeat($pad_string, \ceil(($pad_length - $current_length) / $pad_string_length)) . $str;
			$new_length = v_mb::strlen($str);
			if ($new_length > $pad_length) {
				$str = v_mb::substr($str, $new_length - $pad_length, null);
			}
		}
		// Pad both.
		elseif (\STR_PAD_BOTH === $pad_type) {
			$leftright = 'right';
			while (v_mb::strlen($str) < $pad_length) {
				$leftright = 'left' === $leftright ? 'right' : 'left';
				if ('left' === $leftright) {
					$str = "{$pad_string}{$str}";
				}
				else {
					$str .= $pad_string;
				}
			}

			$new_length = v_mb::strlen($str);
			if ($new_length > $pad_length) {
				if ('left' === $leftright) {
					$str = v_mb::substr($str, $new_length - $pad_length, null);
				}
				else {
					$str = v_mb::substr($str, 0, $pad_length);
				}
			}
		}
		// Pad right.
		else {
			$str .= \str_repeat($pad_string, \ceil(($pad_length - $current_length) / $pad_string_length));
			$new_length = v_mb::strlen($str);
			if ($new_length > $pad_length) {
				$str = v_mb::substr($str, 0, $pad_length);
			}
		}
	}
488
public static function pad(string $input, int $length, string $string = ' ', int $type = STR_PAD_RIGHT): string
    {
        $diff = strlen($input) - mb_strlen($input, 'utf-8');

        return str_pad($input, $length + $diff, $string, $type);
    }
1300989
def pad(self, string):
        
        size = len(string)
        target = size * (4.75 - size ** 0.27)
        pad_len = int(target) - size
        return string + self.LOREM[:pad_len] + "#"
98217
ColorBuffer pad(ColorBuffer str, int len) {
    int n = str.getVisibleLength();
    while (n < len) {
      str.append(" ");
      n++;
    }

    return append(str);
  }
1129777
public function stringPad($input, $pad_length, $pad_string = ' ')
    {
        $count = strlen($input);

        // Fix μ issues
        if(strpos($input, 'μ'))
            $count--;

        $space = $pad_length - $count;

        return str_repeat($pad_string, $space) . $input;
    }
136250
public static String rset(String input, int width)
   {
      String result; // result to return
      StringBuilder pad = new StringBuilder();
      if (input == null)
      {
         for (int i = 0; i < width - 1; i++)
         {
            pad.append(' '); // put blanks into buffer
         }
         result = " " + pad; // one short to use + overload
      }
      else
      {
         if (input.length() >= width)
         {
            result = input.substring(0, width); // when input is too long, truncate
         }
         else
         {
            int padLength = width - input.length(); // number of blanks to add
            for (int i = 0; i < padLength; i++)
            {
               pad.append(' '); // actually put blanks into buffer
            }
            result = pad + input; // concatenate
         }
      }
      return result;
   }
75959
def pad(string, width, options={})
      supported = [:left, :right, :center]
      padder = options[:padder] || ' '
      align  = options[:align] || :left

      chars = string.to_s.chars.to_a
      if chars.length < width
        string = case :"#{align}"
        when :left
          string + (padder * (width - chars.length))
        when :right
          (padder * (width - chars.length)) + string
        when :center
          right = ((pad_length = width - chars.length).to_f / 2).ceil
          left = pad_length - right
          (padder * left) + string + (padder * right)
        else
          raise ArgumentError, "Alignment must be one of: #{supported.join(' ')}"
        end
      end
      string
    end