TestersLesson 62Free preview
String Inspector
This lesson is part of Web Developer Tools · All levels
Summary
String inspector helps to check the content of the string in detail, including length, character code, number of bytes, and invisible characters. This tool is useful when debugging text that looks the same but fails to be validated or saved. By looking at the character representation, the encoding and hidden spacing problems are discovered more quickly.
Key points
- The length of the characters is not always equal to the number of bytes
- Non-ASCII Unicode characters can take more than one byte
- The invisible character is like a zero-width space that's hard to see with the naked eye.
- CharCodeAt returns the unit UTF-16, not always the full code point
- Trim clears the spaces at the beginning and end, but not the spaces in the middle
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.