StringUtils SimplifyWhitespace Method C# API
Replaces one or more consecutive white space characters by a single space character, and trims white space from each end of a string.

Namespace: Facilita.Util
Assembly: fc_clr (in fc_clr.dll) Version: 9.5.7.98
Syntax

public static string SimplifyWhitespace(
	string text
)

Parameters

text
Type: System String
The string to be modified.

Return Value

The modified string.
Remarks

White space comprises of the characters " \t\n\r" - space, tab, line feed and newline.
Examples

The following example demonstrates removing extraneous whitespace from a string.
string s = "  This is  a\t\rstring\n\nwith white space  ";
s = StringUtils.SimplifyWhiteSpace(s);
// s now contains "This is a string with white space"
See Also