Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > String and escape characters

Reply
Thread Tools

String and escape characters

 
 
polilop
Guest
Posts: n/a
 
      12-15-2006
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


 
Reply With Quote
 
 
 
 
Andreas Leitgeb
Guest
Posts: n/a
 
      12-15-2006
polilop <(E-Mail Removed)> wrote:
> 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.
 
Reply With Quote
 
 
 
 
polilop
Guest
Posts: n/a
 
      12-15-2006
Didn't look at the message after i posted it, good you figured it out. thx
alot
"Andreas Leitgeb" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed).. .
> polilop <(E-Mail Removed)> wrote:
>> 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a function to remove escape characters from a string ? Stef Mientki Python 11 12-28-2008 02:19 AM
How to read strings cantaining escape character from a file and useit as escape sequences? slomo Python 5 12-02-2007 11:39 AM
mac and pc escape characters JJ ASP .Net 4 06-26-2007 10:21 AM
Converting a Java String to XML with escape characters thelemmings@gmail.com Java 5 02-05-2007 04:19 PM
Re: html special character and escape characters knowledgepays@hotmail.com ASP .Net 0 01-27-2005 02:08 AM



Advertisments