Your questions answered

Miscellaneous questions

Question M1: I am wondering why the line Array.getChar(string, number) doesn't work. It seems like Apps Script doesn't load the Arrays library. I also have practically no experience with Java…

Google Apps Script is based on ECMAScript. Since the JavaScript programming language is also based on ECMAScript, many JavaScript functions will also work in Apps Script.

The code Array.getChar(string, number), however, is from the Java programming language, which is different from the JavaScript programming language.

In JavaScript (or Apps Script), to access the element at position i in an array arr, use arr[i].

Example

var colors = ['red', 'blue', 'green'];
Logger.log(colors[1]);

Please consider reading the following tutorials:

Sign up to be notified when I publish new content

By signing up you agree to the Privacy Policy & Terms.