Type: Scalar function

This function replaces all blocks of continuous whitespace within a string with a single space character. Also, any leading and trailing whitespace is trimmed.

List of ASCII-characters considered whitespace:
9 Horizontal tab
10 New line
11 Vertical tab
12 Form feed
13 Carriage return
32 Space

Return value: nvarchar(max)

The trimmed string


@Str mandatory nvarchar(max)
The string to reduce