Repeat Function

Hi,

I have a list of string , like {"Apple","Orange","Mango"}.  I need to repeat the string 3 times.  When I give the following repeat command:

apply(repeat(3,_),{"Apple","Orange","Mango"})

I am getting the result as {"Apple","Apple","Apple","Orange","Orange","Orange", "Mango","Mango","Mango"}

But I want the result as {"Apple","Orange","Mango","Apple","Orange","Mango","Apple","Orange","Mango", }

How can I achieve this?

Thanks in advance

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer
    over 4 years ago

    Hi Brinda,

    Try the below:
    a!flatten(
    a!forEach(
                 items: enumerate(3),
                 expression: {
                                   "Apple",
                                   "Orange",
                                   "Mango"
                                }
            )
    )

Reply
  • +1
    Certified Lead Developer
    over 4 years ago

    Hi Brinda,

    Try the below:
    a!flatten(
    a!forEach(
                 items: enumerate(3),
                 expression: {
                                   "Apple",
                                   "Orange",
                                   "Mango"
                                }
            )
    )

Children