replacing CR with <BR>

Discussion in 'ASP .Net' started by Saber, Jul 30, 2004.

  1. Saber

    Saber Guest

    I'm using a multiline textbox as a simple editro.
    I want to change all CRs in textbox with <BR>,
    Is there a way better than using For loops and replace CR with <BR> one by
    one?
    Saber, Jul 30, 2004
    #1
    1. Advertising

  2. Saber

    Jos Guest

    Saber wrote:
    > I'm using a multiline textbox as a simple editro.
    > I want to change all CRs in textbox with <BR>,
    > Is there a way better than using For loops and replace CR with <BR>
    > one by one?


    You didn't say which language you use.

    This is for VB:
    Dim Text2 As String = TextBox1.Text.Replace(vbCRLF,"<BR>")

    --

    Jos
    Jos, Jul 30, 2004
    #2
    1. Advertising

  3. Saber

    Raterus Guest

    something wrong with using the Replace function?

    newstring = txtMultiline.text.replace(vbCrLf, "<br>")

    "Saber" <saber[--AT--]maghalat.com> wrote in message news:...
    > I'm using a multiline textbox as a simple editro.
    > I want to change all CRs in textbox with <BR>,
    > Is there a way better than using For loops and replace CR with <BR> one by
    > one?
    >
    >
    Raterus, Jul 30, 2004
    #3
  4. Saber

    Guest

    On Fri, 30 Jul 2004 20:35:17 +0430, "Saber"
    <saber[--AT--]maghalat.com> wrote:

    >I'm using a multiline textbox as a simple editro.
    >I want to change all CRs in textbox with <BR>,
    >Is there a way better than using For loops and replace CR with <BR> one by
    >one?
    >


    the string class has replace functions.

    -Adam
    , Jul 30, 2004
    #4
  5. Saber

    Saber Guest

    Thanks All,
    I didn't knew there is such a good function.
    thanks again

    "Jos" <> wrote in message
    news:uwL%239$...
    > Saber wrote:
    >> I'm using a multiline textbox as a simple editro.
    >> I want to change all CRs in textbox with <BR>,
    >> Is there a way better than using For loops and replace CR with <BR>
    >> one by one?

    >
    > You didn't say which language you use.
    >
    > This is for VB:
    > Dim Text2 As String = TextBox1.Text.Replace(vbCRLF,"<BR>")
    >
    > --
    >
    > Jos
    >
    >
    Saber, Jul 30, 2004
    #5
  6. Saber wrote:

    > I'm using a multiline textbox as a simple editro.
    > I want to change all CRs in textbox with <BR>,
    > Is there a way better than using For loops and replace CR with <BR> one by
    > one?
    >
    >

    use the replace(textvar,IDCRs,"<br>")

    where IDCRs is the chr()
    eli rodriguez, Aug 2, 2004
    #6
    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. lucky
    Replies:
    11
    Views:
    2,552
    Lucky
    Nov 11, 2005
  2. Salman
    Replies:
    1
    Views:
    411
    Jonathan Bromley
    Apr 5, 2005
  3. Laszlo

    replacing

    Laszlo, Aug 26, 2003, in forum: Perl
    Replies:
    1
    Views:
    1,086
    Peter Jones
    Aug 26, 2003
  4. Ben Holness
    Replies:
    0
    Views:
    5,422
    Ben Holness
    Jan 6, 2006
  5. Rob Meade

    Replacing - and not Replacing...

    Rob Meade, Apr 5, 2005, in forum: ASP General
    Replies:
    5
    Views:
    259
    Chris Hohmann
    Apr 11, 2005
Loading...

Share This Page