Trim
Removes whitespace characters from the begining and the end of the string.
Read time 3 minutesLast updated 7 days ago
Definition
- Type: Method
- Namespace: Unity.Collections
- Assembly: UnityEngine.ManagedKernelModule
Trim<T>(T)
Removes whitespace characters from the begining and the end of the string.
public static T Trim<T>(this ref T fs) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type | Description |
|---|---|
| T | Returns instance of this string with whitespace characters removed from the begining and the end of the string. |
Trim(UnsafeText, AllocatorHandle)
Removes whitespace characters from the begining and the end of the string.
public static UnsafeText Trim(this ref UnsafeText fs, AllocatorManager.AllocatorHandle allocator)
Parameters
A UnsafeText string to perform operation.
The AllocatorManager.AllocatorHandle allocator type to use.
Returns
Type | Description |
|---|---|
| UnsafeText | Returns instance of this string with whitespace characters removed from the begining and the end of the string. |
Trim(NativeText, AllocatorHandle)
Removes whitespace characters from the begining and the end of the string.
public static NativeText Trim(this ref NativeText fs, AllocatorManager.AllocatorHandle allocator)
Parameters
A NativeText string to perform operation.
The AllocatorManager.AllocatorHandle allocator type to use.
Returns
Type | Description |
|---|---|
| NativeText | Returns instance of this string with whitespace characters removed from the begining and the end of the string. |
Trim<T>(T, ReadOnlySpan<Rune>)
Removes specific characters from the begining and the end of the string.
public static T Trim<T>(this ref T fs, ReadOnlySpan<Unicode.Rune> trimRunes) where T : unmanaged, INativeList<byte>, IUTF8Bytes
Parameters
Returns
Type | Description |
|---|---|
| T | Returns instance of this string with specific characters removed from the begining and the end of the string. |
Trim(UnsafeText, AllocatorHandle, ReadOnlySpan<Rune>)
Removes specific characters from the begining and the end of the string.
public static UnsafeText Trim(this ref UnsafeText fs, AllocatorManager.AllocatorHandle allocator, ReadOnlySpan<Unicode.Rune> trimRunes)
Parameters
A UnsafeText string to perform operation.
The AllocatorManager.AllocatorHandle allocator type to use.
Runes that should be trimmed.
Returns
Type | Description |
|---|---|
| UnsafeText | Returns instance of this string with specific characters removed from the begining and the end of the string. |
Trim(NativeText, AllocatorHandle, ReadOnlySpan<Rune>)
Removes specific characters from the begining and the end of the string.
public static NativeText Trim(this ref NativeText fs, AllocatorManager.AllocatorHandle allocator, ReadOnlySpan<Unicode.Rune> trimRunes)
Parameters
A NativeText string to perform operation.
The AllocatorManager.AllocatorHandle allocator type to use.
Runes that should be trimmed.
Returns
Type | Description |
|---|---|
| NativeText | Returns instance of this string with specific characters removed from the begining and the end of the string. |