StringExtensions.TrimInside Method

Namespace:
Weavy.Core.Helpers
Assembly:
Weavy.Core.dll

TrimInside(string, bool)

Removes all duplicate white-space (replacing it with single space) from the string. Also removes all leading and trailing whitespace.

public static string TrimInside(this string text, bool br = false)

Parameters

text
string

The text with white-space to remove.

br
bool

true to keep line breaks, otherwise false.

Returns

string

A string with duplicate white-space replaced with a single space or null if the text contained only whitespace.