How to use arrays in google app script?

I have a URL which i want to split at ‘=’ and put it in an array and then get the second values of the array
how to achieve this in app script ?

Did you try :

urlname[ x ] = new Array(100);

what does it do? because i have no knowledge about arrays

Creates an array of 100 positions.
First try :
urlname[ ]= new Array(100);

var string = “”;
var list = new Array(100);

string = sheet.getRange(2,2).getValue();
list = string.split(’=’);
Logger.log(list[2]);

I get the result null

list or list[ ] or list[ 1] ?

I don’t understand what you mean, i just want to get the second value after splitting the url at ‘=’

yourlist =string.split(’=’);
list[1]=yourlist
Where 1 is a position in your array.
The next URL in second position in array.
list[2]…next list[3]

thanks it worked

1 Like

I feel that your idea is growing… :+1:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.