Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

FixedStringMethods.Trim

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static T Trim(ref T fs);

Parameters

Parameter Description
fs A string to perform operation.

Returns

T Returns instance of this string with whitespace characters removed from the begining and the end of the string.

Description

Removes whitespace characters from the begining and the end of the string.


Declaration

public static UnsafeText Trim(ref UnsafeText fs, AllocatorHandle allocator);

Parameters

Parameter Description
fs A UnsafeText string to perform operation.
allocator The AllocatorHandle allocator type to use.

Returns

UnsafeText Returns instance of this string with whitespace characters removed from the begining and the end of the string.

Description

Removes whitespace characters from the begining and the end of the string.


Declaration

public static NativeText Trim(ref NativeText fs, AllocatorHandle allocator);

Parameters

Parameter Description
fs A NativeText string to perform operation.
allocator The AllocatorHandle allocator type to use.

Returns

NativeText Returns instance of this string with whitespace characters removed from the begining and the end of the string.

Description

Removes whitespace characters from the begining and the end of the string.


Declaration

public static T Trim(ref T fs, ReadOnlySpan<Rune> trimRunes);

Parameters

Parameter Description
fs A string to perform operation.
trimRunes Runes that should be trimmed.

Returns

T Returns instance of this string with specific characters removed from the begining and the end of the string.

Description

Removes specific characters from the begining and the end of the string.


Declaration

public static UnsafeText Trim(ref UnsafeText fs, AllocatorHandle allocator, ReadOnlySpan<Rune> trimRunes);

Parameters

Parameter Description
fs A UnsafeText string to perform operation.
allocator The AllocatorHandle allocator type to use.
trimRunes Runes that should be trimmed.

Returns

UnsafeText Returns instance of this string with specific characters removed from the begining and the end of the string.

Description

Removes specific characters from the begining and the end of the string.


Declaration

public static NativeText Trim(ref NativeText fs, AllocatorHandle allocator, ReadOnlySpan<Rune> trimRunes);

Parameters

Parameter Description
fs A NativeText string to perform operation.
allocator The AllocatorHandle allocator type to use.
trimRunes Runes that should be trimmed.

Returns

NativeText Returns instance of this string with specific characters removed from the begining and the end of the string.

Description

Removes specific characters from the begining and the end of the string.