@Eep² The script posted by me works for
s p a c e d o u t w o r d s with a single normal space between each character and two normal spaces between the words
spaced out words. If the result is not as posted here, there are other whitespace characters than horizontal tab and normal space between the words like a no-break space.
Click in ribbon mode on ribbon tab
View in first group
Display on the check box item
Spaces / tabs. Click in toolbar/menu mode with contemporary menus in menu
View on the menu item
Spaces / tabs. Click in the toolbar/menu mode with traditional menus in menu
View on the menu item
Show spaces/tabs. A normal space is displayed now with
· and a horizontal tab with
» while other whitespace characters are still displayed as defined by the used font.
Set the caret left to the whitespace character
not displayed now with
· or
» and click in toolbar/menu mode with traditional menus on the menu item
Character properties. In toolbar/menu mode with contemporary menus click in menu
Edit on the menu item
Character info. Click in ribbon mode on ribbon tab
Edit in second group
Review on the item
Character info. The
Character Properties window is displayed showing the decimal and hexadecimal value of the character. A no-break space has the decimal value 160 which is hexadecimal 0xa0.
There can be following three variants of whitespace sequences between two words with at least one no-break space:
- A normal space followed by a no-break space where it would be best to delete the no-break space (second whitespace) and keep the normal space (first whitespace).
- A no-break space followed by a normal space where it would be best to delete the no-break space (first whitespace) and keep the normal space (second whitespace).
- Two no-break spaces where it would be best to replace both no-break spaces by one normal space.
It is perhaps possible to do all the space removals / replaces with a single Perl regular expression replace all on selected text, but that is not trivial. It would be easier to use multiple replaces on the selected text if there are all three variants possible at the same time. It would be easier to use a single Perl regular expression replace all on selected text if just one of the three variants exist usually in the text to modify.