genX

Generates a string containing the provided pattern repeated by the given number of times

string
genX
(
size_t count
,
string pattern
)

Parameters

count size_t

the number of times to repeat the pattern

pattern string

the pattern itself

Return Value

Type: string

the repeated pattern

Examples

Tests the generation of a pattern

string pattern = "YOLO";
size_t count = 2;

string output = genX(count, pattern);
assert(output == "YOLOYOLO");

Meta