Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2006

Tip: Looking for answers? Try searching our database.

String and escape characters

Thread view: 
polilop - 15 Dec 2006 12:26 GMT
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
Andreas Leitgeb - 15 Dec 2006 13:09 GMT
> 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.
polilop - 15 Dec 2006 15:18 GMT
Didn't look at the message after i posted it, good you  figured it out. thx
alot
>> 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',
[quoted text clipped - 17 lines]
> (*): these days aren't all that old: for PCL printers, this
>  character still has its meaning.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.