Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to replace enter to <br/>

    Well, I have the following code:
    Code:
    <%
    dim x
    x="k"
    response.write Replace(x,"k","<br/>")
    %>
    now how can I change it so instead of k it will replace enter to <br/>?

  • #2
    Regular Coder
    Join Date
    May 2005
    Location
    Michigan, USA
    Posts
    566
    Thanks
    0
    Thanked 0 Times in 0 Posts
    vbCrLf
    Note: I do not test code. I just write it off the top of my head. There might be bugs in it! But if any thing I gave you the overall theory of what you need to accomplish. Also there are plenty of other ways to accomplish this same thing. I just gave one example of it. Other ways might be faster and more efficient.

  • #3
    New Coder
    Join Date
    Feb 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <form method="post">
    <textarea name="thing"></textarea>
    
    <input type="submit">
    </form>
    <%
    dim text
    text=request.form("thing")
    text=Replace(text,"vbCrLf","<br/>")
    response.write text
    %>
    If i type in the text area:
    1
    1
    it shows 1 1 =\

  • #4
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    text=Replace(text,vbCrLf,"<br>")
    or for XHTML
    Code:
    text=Replace(text,vbCrLf,"<br />")

  • #5
    New Coder
    Join Date
    Feb 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ah, I see, thnkas


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •