Pad to the right

@param int $length
@param string $character

@return self
540387
public function rightPad(int $length, string $character = ' '): self
    {
        return $this->pad($length, $character, self::PAD_RIGHT);
    }
503069
public function appendPosition($length)
    {
        $this->dataPosition = (int) $this->dataPosition;
        $this->dataPosition += (int) $length;
        return $this;
    }
1327548
public function limit($offset, $length = null)
    {
        if (is_null($length) && strpos($offset, ',')) {
            list($offset, $length) = explode(',', $offset);
        }

        $this->options['limit'] = intval($offset) . ($length ? ',' . intval($length) : '');

        return $this;
    }
934840
public function rightTrim(string $mask = null): self
    {
        return new self(
            $mask === null ? \rtrim((string) $this) : \rtrim((string) $this, $mask),
            $this->encoding
        );
    }
1168151
public function length($length = 2)
    {
        $this->length = (int) $length;
        $this->initials = $this->generateInitials();

        return $this;
    }
314683
function padRight(x, padding) {
  if (x) {
    x += '';
  } else {
    x = '';
  }
  var buf = [];
  while (buf.length + x.length < padding) {
    buf.push('0');
  }
  return x + buf.join('');
}
394568
public static function randomAlphabetAndDigit($length)
    {
        $charsSpace = self::DIGIT.self::ALPHABET;
        return self::randomByCharsSpace($length, $charsSpace);
    }
900128
public function char($column, $length = null)
    {
        $length = $length ?: Builder::$defaultStringLength;

        return $this->addColumn('char', $column, compact('length'));
    }
1289388
public function setLength(int $length) : self
    {
        $this->minLength = $length;
        $this->maxLength = $length;

        return $this;
    }
1109802
public AsciiTable setPaddingRightChar(Character paddingRightChar) {
		for(AT_Row row : this.rows){
			if(row.getType()==TableRowType.CONTENT){
				row.setPaddingRightChar(paddingRightChar);
			}
		}
		return this;
	}
1063199
public function pad(int $length, string $string, $type = null) : Manipulator
    {
        return new static(str_pad($this->string, $length, $string, $type));
    }
234523
public function resize($size, $char = "\0")
  {
    $chars = ($size - $this->count());

    if($chars < 0)
    {
      $this->string = substr($this->string, 0, $chars);
    }
    elseif($chars > 0)
    {
      $this->string = str_pad($this->string, $size, strval($char));
    }

    return $this;
  }
258366
public function right($text, $length)
    {
        if (!$this->isValidLength($text, $length)) return $text;

        $textLength = strlen($text);

        return \substr($text, $textLength - $length, $textLength);
    }
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;
    }
943511
protected function padLeft(string $value, int $length): string
    {
        return str_pad($value, $length, '0', STR_PAD_LEFT);
    }
890390
public AsciiTable setPaddingRight(int paddingRight) {
		for(AT_Row row : this.rows){
			if(row.getType()==TableRowType.CONTENT){
				row.setPaddingRight(paddingRight);
			}
		}
		return this;
	}
192452
public function substr($start, $length = null)
  {
    $string = ($length !== null) ? substr($this->string, $start, $length) : substr($this->string, $start);

    return new self($string);
  }