query
On this page

replicate

lib.strings.replicate

Docs pulled from | This Revision | 10 minutes ago


Repeat a string n times, and concatenate the parts into a new string.

Inputs

n
1. Function argument
s
2. Function argument

Type

replicate :: int -> string -> string

Examples

lib.strings.replicate usage example

replicate 3 "v"
=> "vvv"
replicate 5 "hello"
=> "hellohellohellohellohello"

Noogle detected

Implementation

The following is the current implementation of this function.

replicate = n: s: concatStrings (lib.lists.replicate n s);