A developer experienced an issue where two identical-looking strings were flagged as different in a test case. Upon investigation, it was discovered that a narrow no-break space character (Unicode 8239) was being used instead of a regular space (Unicode 32). The narrow no-break space is used to avoid awkward line breaks in text, especially for time formats and other cases where breaking text could lead to confusion. The developer resolved the issue by including the narrow no-break space in the expected string and provided an extension method to handle this formatting more robustly.
Table of contents
A debugging story about 2 identical (looking) strings that weren’t so identical after all.MysteryThe InvestigationThe RevelationThe Solution1 Comment
Sort: