You can test the code by using Logger.log()
.
function sandbox() {
var String = "One,Three,Eight";
var temp = String.split(",");
Logger.log(temp);
}
This will show you the following value for temp
: [One, Three, Eight]
If you log the elements of the array:
temp[0]
= 'One'
temp[1]
= 'Three'
temp[2]
= 'Eight'
If you use temp[1][0]
you get the first letter from 'Three'.
Reference:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…