g.js — graphical objects for JavaScript

characterAtcharacterAt

Output the character at a given index.

var text = 'Hello';
g.characterAt(text, 0);

Character indices start at zero, and wrap around:

var text = 'Hello';
g.characterAt(text, 5);

Parameters

  • s: The input string.
  • index: The index of the character.