FixedStringMethods
Provides extension methods for FixedString"N"Bytes, NativeText, UnsafeText, and string, including appending, formatting, and parsing numbers.
Read time 2 minutesLast updated 6 days ago
Definition
- Type: Class
- Namespace: Unity.Collections
- Assembly: UnityEngine.ManagedKernelModule
public static class FixedStringMethods
Static Methods
Method | Description |
|---|---|
| Append | Appends bytes to this string. |
| AppendFormat | Interpolates strings into a format string and appends the result to this string. |
| AppendRawByte | Appends a byte to this string. |
| CompareTo | Returns the sort position of this string relative to a byte sequence. |
| ComputeHashCode | Returns a hash code of this string. |
| Contains | Returns true if a given substring occurs within this string. |
| ConvertToString | Returns a copy of this string as a managed string. |
| CopyFrom | Copies another string to this string (making the two strings equal). Replaces any existing content of the FixedString. |
| CopyFromTruncated | Copies another string to this string. If the string exceeds the capacity it will be truncated. Replaces any existing content of the FixedString. |
| EffectiveSizeOf | Returns the effective size in bytes of this string. |
| EndsWith | Returns true if a given character occurs at the end of this string. |
| Equals | Returns true if this string and a byte sequence are equal (meaning they have the same length and content). |
| IndexOf | Returns the index of the first occurrence of a byte sequence in this string. |
| LastIndexOf | Returns the index of the last occurrence of a byte sequence within this string. |
| Parse | Parses an int from this string starting at a byte offset. |
| Peek | Returns the Unicode.Rune at an index of this string. |
| Read | Returns the Unicode.Rune at an index of this string. Increments the index to the position of the next character. |
| StartsWith | Returns true if a given character occurs at the beginning of this string. |
| Substring | Retrieves a substring of this string. The substring starts from a specific character index and continues to the end of the string. The new substring has the same allocator as the string. |
| ToLowerAscii | Converts string to lowercase only ASCII characters. |
| ToUpperAscii | Converts string to uppercase only ASCII characters. |
| Trim | Removes whitespace characters from the begining and the end of the string. |
| TrimEnd | Removes whitespace characters from the end of the string. |
| TrimStart | Removes whitespace characters from begining of the string. |
| Write | Writes a Unicode.Rune at an index of this string. Increments the index to the position of the next character. |