1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-09-02 01:22:37 +02:00

Added repeat

This commit is contained in:
Daniel St. Jules
2015-07-23 23:53:33 -07:00
parent bded15d683
commit 2d34e72cde
3 changed files with 49 additions and 2 deletions

View File

@@ -1094,6 +1094,19 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
}
/**
* Returns a repeated string given a multiplier. An alias for str_repeat.
*
* @param int $multiplier The number of times to repeat the string
* @return Stringy Object with a repeated str
*/
public function repeat($multiplier)
{
$repeated = str_repeat($this->str, $multiplier);
return static::create($repeated, $this->encoding);
}
/*
* A multibyte str_shuffle() function. It returns a string with its
* characters in random order.
*