예제 #1
0
 public function testRepeat()
 {
     $str = new MString('一二三四五');
     $this->assertEquals('一二三四五一二三四五一二三四五', \strval($str->repeat(3)));
 }
예제 #2
0
파일: MString.php 프로젝트: dazarobbo/cola
 /**
  * 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);
 }