public function testRepeat() { $str = new MString('一二三四五'); $this->assertEquals('一二三四五一二三四五一二三四五', \strval($str->repeat(3))); }
/** * Returns a new string padded $num number of times at the end * @param int $num * @param self $char * @return \static */ public function padRight($num, self $char) { if (!\is_numeric($num)) { throw new \InvalidArgumentException('$num is not an int'); } return new static($this->_Value . $char->repeat($num)->_Value, $this->_Encoding); }