Method EffectiveSizeOf
EffectiveSizeOf<T>(ref T)
Returns the effective size in bytes of this string.
Declaration
public static int EffectiveSizeOf<T>(this ref T fs) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Type | Name | Description |
---|---|---|
T | fs | A string to get the effective size of. |
Returns
Type | Description |
---|---|
int | The effective size in bytes of this string. |
Type Parameters
Name | Description |
---|---|
T | A string type. |
Remarks
"Effective size" is Length + 3
, the number of bytes you need to copy when serializing the string.
(The plus 3 accounts for the null-terminator byte and the 2 bytes that store the Length).
Useful for checking whether this string will fit in the space of a smaller string.