Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


CopyFromTruncated

Copies another string to this string. If the string exceeds the capacity it will be truncated. Replaces any existing content of the FixedString.
Read time 1 minuteLast updated 8 days ago

Definition

  • Type: Method
  • Namespace: Unity.Collections
  • Assembly: UnityEngine.ManagedKernelModule

CopyFromTruncated<T>(T, string)

Copies another string to this string. If the string exceeds the capacity it will be truncated. Replaces any existing content of the FixedString.
[ExcludeFromBurstCompatTesting("Takes managed string")]public static CopyError CopyFromTruncated<T>(this ref T fs, string s) where T : unmanaged, INativeList<byte>, IUTF8Bytes

Parameters

fs

T
The destination string.

The source string.

Returns

Type

Description

CopyErrorCopyError.None if successful. Returns CopyError.Truncation if the source string is too large to fit in the destination.

CopyFromTruncated<T, U>(T, T)

Copies another string to this string. If the string exceeds the capacity it will be truncated.
public static CopyError CopyFromTruncated<T, T2>(this ref T fs, in T2 input) where T : unmanaged, INativeList<byte>, IUTF8Bytes where T2 : unmanaged, INativeList<byte>, IUTF8Bytes

Parameters

fs

T
The destination string.

input

T
The source string.

Returns

Type

Description

CopyErrorCopyError.None if successful. Returns CopyError.Truncation if the source string is too large to fit in the destination.

Remarks

When the method returns an error, the destination string is not modified.