size

size(): Integer;

The size method of the StringUtf8 primitive type returns the number of bytes required to store the receiver. Note that this value does not include the null character that marks the end of the string.

The following example shows the use of the size method.

vars
    str8 : StringUtf8;
begin
    str8 := @"JADE";
    write str8.size;            // 4 bytes - one for each ASCII character
    str8 := @"©";
    write str8.size;            // 2 bytes for the copyright symbol
    str8 := @"€";
    write str8.size;            // 3 bytes for the euro currency symbol
end;