Carriage Return, Tab

Discussion in 'ASP .Net' started by Jim Heavey, May 13, 2004.

  1. Jim Heavey

    Jim Heavey Guest

    In the Regular Expression, I can use \n for Line Feed, \t for a tab and \r
    for carriage return. Am I able to use thos same expressions in a "Replace
    method" of the string object? such as

    NewDescrp = NewDescrp.Replace('\n', ' '); //replace Line feed with space
    NewDescrp = NewDescrp.Replace('\t', ' '); //replace vertical tab with
    space
    NewDescrp = NewDescrp.Replace('\r', ' '); //replace Carriage return with a
    space


    The ASCII values are something like 10, 11 and 13. How would I specify the
    numbers rather then these escape sequence values?

    Thanks
     
    Jim Heavey, May 13, 2004
    #1
    1. Advertising

  2. Jim Heavey

    AlexS Guest

    Hi, Jim

    take a look at regular expression syntax to see what is possible.
    In your case you can specify hex codes using \x

    for example, \x22 is denoting "

    HTH
    Alex

    "Jim Heavey" <> wrote in message
    news:Xns94E7E12DFB7F5JimHeaveyhotmailcom@207.46.248.16...
    > In the Regular Expression, I can use \n for Line Feed, \t for a tab and \r
    > for carriage return. Am I able to use thos same expressions in a "Replace
    > method" of the string object? such as
    >
    > NewDescrp = NewDescrp.Replace('\n', ' '); //replace Line feed with space
    > NewDescrp = NewDescrp.Replace('\t', ' '); //replace vertical tab with
    > space
    > NewDescrp = NewDescrp.Replace('\r', ' '); //replace Carriage return with a
    > space
    >
    >
    > The ASCII values are something like 10, 11 and 13. How would I specify

    the
    > numbers rather then these escape sequence values?
    >
    > Thanks
     
    AlexS, May 13, 2004
    #2
    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. Ferdi
    Replies:
    5
    Views:
    4,730
    Jacob Yang [MSFT]
    Aug 24, 2003
  2. Kevin Spencer
    Replies:
    3
    Views:
    3,258
    Doc Wally
    Oct 11, 2003
  3. Dave
    Replies:
    3
    Views:
    537
    nick chan
    Jul 2, 2008
  4. Xeno Campanoli
    Replies:
    0
    Views:
    246
    Xeno Campanoli
    Feb 13, 2006
  5. Steve Anderson
    Replies:
    3
    Views:
    277
    Steve Anderson
    Jun 21, 2004
Loading...

Share This Page