Pad Right
Pads a string to the right.

@param val the string to be padded.
@param len the length to pad.
@param offset an offset value to add.
@param char the character to pad with.
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;
}
558172
public void setValue(char[] chars, int offset, int len) {
		checkNotNull(chars);
		if (offset < 0 || len < 0 || offset > chars.length - len) {
			throw new IndexOutOfBoundsException();
		}

		ensureSize(len);
		System.arraycopy(chars, offset, this.value, 0, len);
		this.len = len;
		this.hashCode = 0;
	}
456508
public Cell<C,T> pad (Value<C,T> pad) {
		padTop = pad;
		padLeft = pad;
		padBottom = pad;
		padRight = pad;
		return this;
	}
366628
protected static String justifyRight(CharSequence csq, char pad, int width) {
        try {
            StringBuilder sb = new StringBuilder(width);
            justifyRight(sb, csq, pad, width);
            return sb.toString();
        } catch (IOException e) {
            throw new AssertionError("StringBuilder failed", e);
        }
    }
1277914
@Override
    public void noteValue(double val) {
        super.noteValue(val);
        buf[insertPos++] = val;
        if (insertPos >= buf.length) {
            insertPos = 0;
            size = buf.length;
        } else if (insertPos > size) {
            size = insertPos;
        }
    }
701109
function padLeft(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 || ' ';
    var pad = '';
    while (len--) {
        pad += char;
    }
    if (offset)
        return padLeft('', offset, null, char) + pad + val;
    return pad + val;
}
948276
protected function pad($string, $len)
    {
        $strlen = $this->strlen($string);
        if ($strlen > $len) return $string;

        $pad = $len - $strlen;
        return $string . str_pad('', $pad, ' ');
    }
219228
function _stringPad(that, maxLength, fillString, left) {
	  var S = String(_defined(that));
	  var stringLength = S.length;
	  var fillStr = fillString === undefined ? ' ' : String(fillString);
	  var intMaxLength = _toLength(maxLength);
	  if (intMaxLength <= stringLength || fillStr == '') return S;
	  var fillLen = intMaxLength - stringLength;
	  var stringFiller = _stringRepeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
	  if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
	  return left ? stringFiller + S : S + stringFiller;
	}
1100313
private static int lengthOfMimeNames(String val) {
        // look for the space preceding the optional high char
        int len = val.indexOf(' ');
        // If len is zero it means the optional part is not there, so
        // the value must be all Mime names, so set the length appropriately
        if (len < 0)  
            len = val.length();
        
        return len;
    }
786931
@Description("concatenates given character strings")
    @ScalarFunction
    @LiteralParameters({"x", "y", "u"})
    @Constraint(variable = "u", expression = "x + y")
    @SqlType("char(u)")
    public static Slice concat(@LiteralParameter("x") Long x, @SqlType("char(x)") Slice left, @SqlType("char(y)") Slice right)
    {
        int rightLength = right.length();
        if (rightLength == 0) {
            return left;
        }

        Slice paddedLeft = padSpaces(left, x.intValue());
        int leftLength = paddedLeft.length();

        Slice result = Slices.allocate(leftLength + rightLength);
        result.setBytes(0, paddedLeft);
        result.setBytes(leftLength, right);

        return result;
    }
376965
public static function padRight(string $string, int $length, string $filler = ' '): string
    {
        while (self::length($string) <= ($length - self::length($filler))) {
            $string = $string . $filler;
        }
        return $string;
    }
1099220
private void addFMPiece(StringBuilder sb, int value, int pad) {
        String val = Integer.toString(value);
        pad -= val.length();
        
        while (pad-- > 0) {
            sb.append('0');
        }
        
        sb.append(val);
    }
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);
    }
608726
function _addStringToBuffer(buffer, val) {
  buffer.putInt32(val.length);
  buffer.putString(val);
}
1006083
@Override
  public void writeStringData(String value, int offset, int length)
  {
    char []cBuf = _charBuffer;
    int cBufLength = cBuf.length;
    
    for (int i = 0; i < length; i += cBufLength) {
      int sublen = Math.min(length - i, cBufLength);
      
      value.getChars(offset + i, offset + i + sublen, cBuf, 0);
      
      writeStringChunk(cBuf, 0, sublen);
    }
  }
969313
function pad(text, length, align = 'left') {
  let pad = ' '.repeat(length - stringWidth(text));
  if (align === 'right') {
    return pad + text;
  }

  return text + pad;
}
470249
public static void writeUnsignedVarint(ByteBuffer buffer, int val) {
    // Extra bytes have the high bit set
    while((val & 0x7F) != val) {
      buffer.put((byte) ((val & 0x7F) | 0x80));
      val >>>= 7;
    }
    // Last byte doesn't have high bit set
    buffer.put((byte) (val & 0x7F));
  }