Text UtilitiesLesson 121Free preview
Remove Blank Lines
This lesson is part of Web Developer Tools · All levels
Summary
Remove blank lines removes blank lines or lines that only contain spaces from a text. This is useful for debugging copy-paste results, or code that has many pauses is not necessary. Some tools maintain one blank line as a paragraph separator. Always keep a backup before you wipe the line in mass.
Key points
- The blank line can be completely empty or contain a white space
- Use trim() to detect both
- Keeping one line blank helps separate the paragraph
- Windows end lines need to be normalized
- Make a backup before the mass is removed.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.