How can I replace numeric entities in a string?
Posted: 12 May 2015 14:00
I'm cleaning up a document, which has plenty of "&x160;" (=non-breaking space) entities; I want to replace them with regular spaces. When I try
search results panel opens up, telling me that "0 items found in 0 of 1 searched files" (sic!). Searching for a "regular" string I get correct message ("in 1 of 1 searched files".)
When I try
nothing is replaced, either.
My guess is that this &x160; should be escaped somehow, but how exactly? When I search for &x160 instead (no closing semicolon) with StringReplaceAll(), I get a message
Code: Select all
Document.ReplaceAll(" ", " ", false, false, false);
When I try
Code: Select all
Document.SelectAll;
s = Document.SelText;
s = ScriptUtils.StringReplaceAll(s, " ", " ");
Document.SelText = s;
My guess is that this &x160; should be escaped somehow, but how exactly? When I search for &x160 instead (no closing semicolon) with StringReplaceAll(), I get a message
"160" is not a valid integer value