![]() |
|
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" ![]() |