k must be a valid index of string. String-ref returns character k of string using zero-origin indexing.