Download Fluency with Information Technology

Transcript
Editing Text Using Substitution
The formatting is a mess. Displaying the text with the formatting characters reveals:
Notice that epsilon is
used only for writing
out substitution expressions for ourselves. In
the find-and-replace of
an application, as in
Figure 2.12, simply
leave the replacement
string empty.
We see that extra spaces and new-line characters have been inserted when we imported the text into the document.
Clearly, removing the groups of eight leading blanks is simple: Replace them with
nothing. When writing the substitution expression, we express “nothing” with the
Greek letter epsilon, which is called the empty string—that is, the string with no letters.
········
←
ε
Removing the leading blanks was easy because they are only at the beginning of the
lines and nowhere else. Correcting the new-line characters is more of a problem.
We want to get rid of the new-lines that have been inserted within a paragraph and
keep the paired new-lines that separate the paragraphs. But getting rid of single newlines
↵ ←
ε
will also get rid of all the new-lines! How can we keep the paired new-lines but
remove the singles?
29