For example (note that \n is a newline):
?- normalize_space(atom(Out), ' \nhello\nworld '). Out = 'hello world'.
| Did you know ... | Search Documentation: |
| White space normalization |
\u0020) character. Out
uses the same conventions as with_output_to/2
and format/3.
A character counts as white space if it satisfies code_type(Code,
space), i.e., the C library function iswspace(). This
depends on the locale. Using a Unicode locale this includes the Unicode
separator characters such as \u00a0 (no-break space) and
\u3000 (ideographic space), while in the C
locale only the ASCII white space characters are recognised. Note that
the
bidi format characters \u200e and \u200f
are not white space and are thus preserved.
For example (note that \n is a newline):
?- normalize_space(atom(Out), ' \nhello\nworld '). Out = 'hello world'.