From RAD Studio API Documentation
Jump to: navigation, search


void SetLength(int newLength);


Type Visibility Source Unit Parent
function public wstring.h System WideString


Changes the length of the WideString.

SetLength changes the WideString’s length to newLength, truncating if necessary.

SetLength reallocates the underlying array of characters that stores the value of the WideString. Existing characters in the string are preserved, but the content of newly allocated space is undefined. If there is not enough memory available to reallocate theWideString, an EOutOfMemory exception is thrown. Following a call to SetLength, the WideString is guaranteed to reference a unique string, that is, a string with a reference count of one.

See Also