Table of Contents

Method Trim

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Trim(string?, char[], bool, bool)

Removes all leading and trailing occurrences of a set of characters specified in an array from the string. trimStart and trimEnd parameters specify whether to remove leading and trailing occurrences.

public static string? Trim(string? s, char[] chars, bool trimStart = true, bool trimEnd = true)

Parameters

s string

String to process.

chars char[]

An array of Unicode characters to remove, or null.

trimStart bool

Whether to trim leading characters.

trimEnd bool

Whether to trim trailing characters.

Returns

string

Trim(string?, bool, bool)

Removes all leading and trailing white-space characters from the string. trimStart and trimEnd parameters specify whether to remove leading and trailing occurrences.

public static string? Trim(string? s, bool trimStart = true, bool trimEnd = true)

Parameters

s string

String to process.

trimStart bool

Whether to trim leading characters.

trimEnd bool

Whether to trim trailing characters.

Returns

string

Trim(string?, TrimTextRules)

Trims the string using the specified text trimming rules.

public static string? Trim(string? s, TrimTextRules rules)

Parameters

s string

String to trim.

rules TrimTextRules

Text trimming rules.

Returns

string