SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Replace with \n

  1. #1
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Replace with \n

    Hey,

    I have a comma delimited string. Within the string, I have a character representing points where I would like to insert line breaks when I display the string in a text area. Ex.

    dim myString
    myString = "variable,value,*variable,value,*variable,value"

    I have tried this:

    dim myNewString
    myNewString = Replace(myString,"*","\n")

    The replace works fine but my "\n" is getting rendered. This makes sense because I have it in quotes and the browser thinks it is part of the string. However, if I don't use quotes, I get an error. How can I get around this? I have tried the replace part of it server side and client side but with the same results. When I submit this string back to the database I want to replace my "\n" with "*".

    Any Ideas?

  2. #2
    Xbox why have you forsaken me? moospot's Avatar
    Join Date
    Feb 2001
    Location
    Clearwater, FL
    Posts
    3,614
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use VbCrLf instead of \n. This will give you a hard break.

    Code:
    myNewString = Replace(myString,"*",vbcrlf)

  3. #3
    ********* obeah makeda's Avatar
    Join Date
    Jun 2001
    Location
    rollin' on dubs
    Posts
    492
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    works perfectly. thanks a lot!

  4. #4
    Xbox why have you forsaken me? moospot's Avatar
    Join Date
    Feb 2001
    Location
    Clearwater, FL
    Posts
    3,614
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Glad I could help!

Bookmarks

Posting Permissions

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