TextUtility.NormalizeWhitespace Method

Namespace
Kampute.DocToolkit.Support
Assembly
  • Kampute.DocToolkit.dll

Definition

Normalizes whitespace characters by replacing sequences of whitespace with a single space.
public static string NormalizeWhitespace(string text, bool trim = true)

Parameters

text string
The input text to normalize.
trim bool optional
Indicates whether to trim leading and trailing whitespace. Default is false.

Returns

string
A string with normalized whitespace.