Name

String accessors — Reading and writing characters into a string

Function

ecl_character ecl_char( cl_object string, cl_index ndx);

ecl_character ecl_char_set( cl_object string, cl_index ndx, ecl_character c);

Description

Access to string information should be done using these two functions. The first one implements the equivalent of the CHAR function from Common Lisp, returning the character that is at position ndx in the string s.

The counterpart of the previous function is ecl_char_set, which implements (SETF CHAR) and stores character c at the position ndx in the given string.

Both functions check the type of their arguments and verify that the indices do not exceed the string boundaries. Otherwise they signal a serious-condition.