How to remove array brackets from the output

shaik_irfan
Tera Guru

Hi,

 

We are getting an output from the script include below which i need to set in the description field, can anyone please help how to remove the array brackets

 

["Database (256 x 229)","Server(564 x 376)", "Network(213 x 125)"]

 

When i am setting the value in the description field it is looking like above

 

how to remove the brackets and display like below

Database (256 x 229),Server(564 x 376), Network(213 x 125)

1 ACCEPTED SOLUTION

Community Alums
Not applicable

That's an array, it should appear as what you want anyway, but if you're getting it showing the full object in the array try doing something like this: 

var resultOfScriptInclude = scriptInclude();
description = resultOfStriptInclude.toString();

When I paste this into a background script: 

var array = ["Database (256 x 229)","Server(564 x 376)", "Network(213 x 125)"];
gs.info(array);

The result is: 

*** Script: Database (256 x 229),Server(564 x 376),Network(213 x 125)

and I get the same result if I do array.toString();

View solution in original post

3 REPLIES 3

Community Alums
Not applicable

That's an array, it should appear as what you want anyway, but if you're getting it showing the full object in the array try doing something like this: 

var resultOfScriptInclude = scriptInclude();
description = resultOfStriptInclude.toString();

When I paste this into a background script: 

var array = ["Database (256 x 229)","Server(564 x 376)", "Network(213 x 125)"];
gs.info(array);

The result is: 

*** Script: Database (256 x 229),Server(564 x 376),Network(213 x 125)

and I get the same result if I do array.toString();

Thank you that was easy 😉

 

Hi,

It is possible or not?

Thanks,

Vikas