These codes are Unicode, not ASCII (for the most part), so you should probably use the replace function with regex , which contains the Unicode character class separator:
replace($text-nodes[1], '\p{Z}+', '')
More details:
The regular expression \p{Z}+ matches one or more characters that are in the Unicode separator category. \p{} is an escape category that matches a single character in the category indicated in curly braces. Z indicates the category "delimiter" (which includes various types of spaces). + means "match the previous regular expression one or more times." The replace function returns the version of its first argument with all nonoverlapping substrings matching the second argument, replaced by the third argument. Thus, this returns the version of $text-nodes[1] , while all sequences of separator characters are replaced by an empty string, ie Are deleted.
source share