I have
array.length=3
array2=['[A]','[B]','[C]','[D]'];
based on array.length, i want to create set of string
example, if lenght=3
output= [A][B][C]
example, if lenght=2
output= [A][B]
i tried using for loop but it prints vertically and could not store and append ,I have no idea how to print horizontally,any ideas or help would be really appreciated
my output is
[A]
[B]
[C]
AND Then i store it in variable and tried appending them. I know this is not the best idea