# EffectiveSizeOf<T>(ref T)

> Returns the effective size in bytes of this string.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

## EffectiveSizeOf\<T>(T)

```csharp
public static int EffectiveSizeOf<T>(this ref T fs) where T : unmanaged, INativeList<byte>, IUTF8Bytes
```

### Parameters

**** (T): A string to get the effective size of.

### Returns

| Type                                                       | Description                                 |
| ---------------------------------------------------------- | ------------------------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The effective size in bytes of this string. |

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