Navigation
Synopsis Return character in a string by its index position.
Function int charAt(str s, int i) throws IndexOutOfBounds(str msg)
Usage import String;
Description Return the character at position i in string s as integer character code. Also see stringChar that converts character codes back to string.
Examples
rascal>import String;
ok
rascal>charAt("abc", 0);
int: 97
rascal>stringChar(charAt("abc", 0));
str: "a"
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.