Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


NativeText.ReadOnly

A read-only alias for the value of a NativeText. Does not have its own allocated storage.
Read time 2 minutesLast updated 6 days ago

Definition

public struct NativeText.ReadOnly : INativeList<byte>, IIndexable<byte>, IUTF8Bytes, IComparable<string>, IEquatable<string>, IComparable<NativeText>, IEquatable<NativeText>, IComparable<FixedString32Bytes>, IEquatable<FixedString32Bytes>, IComparable<FixedString64Bytes>, IEquatable<FixedString64Bytes>, IComparable<FixedString128Bytes>, IEquatable<FixedString128Bytes>, IComparable<FixedString512Bytes>, IEquatable<FixedString512Bytes>, IComparable<FixedString4096Bytes>, IEquatable<FixedString4096Bytes>

Properties

Property

Description

CapacityThe current capacity in bytes of this string.
IsEmptyWhether this string has no characters.
this[]The byte at an index.
LengthThe current length in bytes of this string.
ValueA copy of this string as a managed string.

Methods

Method

Description

ClearSets the length to 0. For a NativeText.Readonly this function does nothing, unless safety checks are enabled (in which case it throws).
CompareToReturns the lexicographical sort order of this string relative to another.
ElementAtReturns a reference to the byte (not character) at an index. Unsupported by NativeText.ReadOnly.
EqualsReturns true if this string and another object are equal.
GetEnumeratorReturns an enumerator for iterating over the characters of the NativeText.
GetHashCodeReturns a hash code of this string.
GetUnsafePtrReturns a pointer to this string's character buffer.
ToStringReturns a managed string copy of this string.
TryResizeAttempt to set the length in bytes of this string. For NativeText.ReadOnly this function is a no-op and always returns false.

Operators

Operator

Description

operator ==Returns true if two strings are equal.
operator !=Returns true if two strings are unequal.