CharArraystores fixed length strings, it displays variable length strings. This is a result of the stripping and padding policies of the CharArray class.
When an element of a
CharArray is fetched trailing whitespace is
stripped off. The sole exception to this rule is that a single whitespace is
never stripped down to the empty string.
whitespace as an ASCII space, formfeed, newline, carriage return, tab, or
When a string is assigned to a
CharArray, the string is considered
terminated by the first of any NULL characters it contains and is padded with
spaces to the full length of the
CharArray itemsize. Thus, the memory
image of a
CharArray element does not include anything at or after the
first NULL in an assigned string; instead, there are spaces, and no terminating
NULL character at all.
When a string which is longer than the
itemsize() is assigned to a
CharArray, it is silently truncated.
RawCharArray baseclass of
CharArray implements transparent
pad() methods, enabling the storage and retrieval of
arbitrary ASCII values within array elements. For
array elements are identical in percieved length. Alternate
stripping and padding policies can be implemented by subclassing
Send comments to the NumArray community.