Esempio n. 1
1
 public function testCopy2()
 {
     $str = CharArray::fromString("Test");
     $str->setSize(5);
     $res = System::arraycopy($str, 1, $str, 2, 3);
     $this->assertEquals("Teest", (string) $res);
 }
Esempio n. 2
0
File: String.php Progetto: phpj/phpj
 /**
  * Copy characters from this string into dst starting at dstBegin.
  * This method doesn't perform any range checking.
  *
  * @param CharArray $dst
  * @param integer $dstBegin
  */
 public function getChars(CharArray $dst, $dstBegin)
 {
     $charArray = CharArray::fromString($this->value);
     System::arraycopy($charArray, 0, $dst, $dstBegin, $charArray->length());
 }
Esempio n. 3
0
 /**
  * @param CharArray $str
  * @param int $start
  * @param int $end
  * @return CharArray
  */
 protected function processStrStartEnd(CharArray $str, $start, $end)
 {
     $this->checkSrcBeginEnd($str, $start, $end);
     $len = $end - $start;
     $strCut = new CharArray($len);
     $str = System::arraycopy($str, $start, $strCut, 0, $len);
     return $str;
 }