String and escape characters

P

polilop

I have a very long string in which i need to remove new lines (\\r\\n)
etc.Managed to remove new lines but in my output i still get ' ', which kind
of escape character is this?Is it EOF? how to remove it?Thanks
 
A

Andreas Leitgeb

polilop said:
I have a very long string in which i need to remove new lines (\\r\\n)
etc.Managed to remove new lines but in my output i still get '^L',
which kind of escape character is this?Is it EOF? how to remove it?Thanks

It's a "eop" (end of page / formfeed) character, that (back in the
old days(*) of plaintext printers) triggered the printer to skip to next
page, and was the reason why accidentally printing a binary file caused
so many sheets of paper to be wasted.

In newsgroups, this character is generally used to hide spoilers:
some usenet-clients hide the text after that char until some
key is pressed. I just saw that happen for your posting. (I now
replaced it with it's ^-char notation, to prevent my answer to
be also hidden.)

The hexcode of that char is 0x0C, and it's backslash-combo
is \f (for: formfeed), so to embed it into a regexp-string
you could use "...\f..." or "...\u000C..."

(*): these days aren't all that old: for PCL printers, this
character still has its meaning.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top