Method Reference: string.repelems

string: B = repelems (A, R)

Construct a vector of repeated elements from a string array.

B = repelems (A, R) returns a string vector B containing repeated elements of the input A, which must be a string vector. R must be a 2×N matrix of integers. Entries in the first row of R correspond to the linear indexing of the elements in A to be repeated. The corresponding entries in the second row of R specify the repeat count of each element.

Source Code: string