Repeat

Function Repeat 

Source
pub fn Repeat(s: impl AsRef<[byte]>, count: uint) -> Vec<byte> 
Expand description

Repeat returns a new string consisting of count copies of the string s.

It panics if count is negative or if the result of (len!(s) * count) overflows.

zh-cn 返回count个b串联形成的新的切片。

§Example

 use gostd_bytes as bytes;

 assert_eq!("121212".as_bytes(),bytes::Repeat("12",3));
 println!("{:?}",bytes::Repeat("12",3).as_slice());

§Output

121212