Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

FixedStringMethods.EffectiveSizeOf

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static int EffectiveSizeOf(ref T fs);

Parameters

Parameter Description
fs A string to get the effective size of.

Returns

int The effective size in bytes of this string.

Description

Returns the effective size in bytes of this string.

"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.