cindex

cindex is a command in the TclX package.

cindex string indexExpr

Return the character of string at the position given by indexExpr.

If the expression indexExpr starts with the string end, then end is replaced with the index of the last character in the string. If the expression starts with len, then len is replaced with the length of the string.

This command is UTF-8-aware.

Note that cindex expects the indexExpr to be zero based.

Consider using Tcl's string index for similar functionality without the need for an extension.