String and escape characters

Discussion in 'Java' started by polilop, Dec 15, 2006.

  1. polilop

    polilop Guest

    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
     
    polilop, Dec 15, 2006
    #1
    1. Advertising

  2. polilop <> 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.
     
    Andreas Leitgeb, Dec 15, 2006
    #2
    1. Advertising

  3. polilop

    polilop Guest

    Didn't look at the message after i posted it, good you figured it out. thx
    alot
    "Andreas Leitgeb" <> wrote in message
    news:...
    > polilop <> 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.
     
    polilop, Dec 15, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    75,403
    opalpa http://opalpa.info
    Feb 5, 2007
  2. JJ

    mac and pc escape characters

    JJ, Jun 26, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    764
  3. slomo
    Replies:
    5
    Views:
    1,632
    Duncan Booth
    Dec 2, 2007
  4. Stef Mientki
    Replies:
    11
    Views:
    10,866
    Martin
    Dec 28, 2008
  5. mix
    Replies:
    4
    Views:
    1,054
    Emile van Sebille
    Oct 30, 2010
Loading...

Share This Page