How to get the comma separated values in an array and split it in client script?

Sripriya2
Kilo Contributor

I am passing the comma separated values from script include to the client script. The requirement is to get that comma separated values in an array. And we need to split the comma separated values. 

1 ACCEPTED SOLUTION

Aman Kumar S
Kilo Patron

You can use split function.

Lets say your comma separated value in variable str;

var arr = str.split(',');// returns the string to an array

Best Regards
Aman Kumar

View solution in original post

3 REPLIES 3

Aman Kumar S
Kilo Patron

You can use split function.

Lets say your comma separated value in variable str;

var arr = str.split(',');// returns the string to an array

Best Regards
Aman Kumar

Hey @Sripriya 

Didn't hear back on this.

Is your issue resolved? If yes, feel free to mark helpful/correct, so it will be helpful for others looking for similar query.

Best Regards
Aman Kumar

Hi,

My issue is resolved. Thank you for the quick response.