The characters are numbered starting with 0. If i is negative, then the i-th entry counting from the end is provided. If i is out of range, an error is signaled.
i1 : s = "what are you thinking?"
o1 = what are you thinking?
i2 : #s
o2 = 22
i3 : s_-1, s_19, s_0
o3 = (?, n, w)
o3 : Sequence
See also
strings and nets -- an overview of strings and nets in Macaulay2
String # ZZ -- get value from list, hash table, database, or string