System.UnicodeString.SetLength

提供: RAD Studio API Documentation
移動先: 案内検索

C++

UnicodeString&  SetLength(int newLength);

プロパティ

種類 可視性 ソース ユニット
function public ustring.h System UnicodeString

説明

UnicodeString の文字長を変更します。

SetLength は、文字列の文字長を newLength に変更し、必要に応じて切り捨てます。

SetLength は、UnicodeString インスタンスの値を格納する文字のベースの配列の再割り当てを行います。文字列内の既存の文字は保持されますが、新たに割り当てられた領域の内容は未定義です。UnicodeString インスタンスの再割り当てに十分なメモリがない場合は、EOutOfMemory 例外が発生します。SetLength の呼び出し後は、UnicodeString インスタンスは共有参照ではなくなります。

SetLength は、変更された UnicodeString オブジェクト(*this)を返します。