Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Capacity

The number of bytes this string has for storing UTF-8 characters.
Read time 1 minuteLast updated 6 days ago

Definition

  • Type: Property
  • Namespace: Unity.Collections
  • Assembly: UnityEngine.ManagedKernelModule
public int Capacity { readonly get; set; }

Remarks

Does not include the null-terminator byte.
A setter is included for conformity with INativeList<T>, but FixedString64Bytes.Capacity is fixed at 61. Setting the value to anything other than 61 throws an exception.
In UTF-8 encoding, each Unicode code point (character) requires 1 to 4 bytes, so the number of characters that can be stored may be less than the capacity.