Results 1 to 3 of 3

Thread: String.replace function

  1. #1
    kayoca
    Guest
    I have a message like this in a database.
    Welcome all, to my Bulletin Board.

    Your free to do anything you like to do.. :)
    When i am showing this message in a HTML page it will look like this.
    Welcome all, to my Bulletin Board.Your free to do anything you like to do.. :)
    But i want to know is how can i replace the return char with <br>? with the
    replace function in JavaScript?

  2. #2
    kayoca
    Guest
    Yes.... i have found the solution for it..
    Code:
    BodyString.replace ( /\n/g, '<br>' );

  3. #3
    Hyperactive Member
    Join Date
    Apr 2001
    Posts
    315
    Also, change "your free" to either "you're free" or "you are free".
    Example.
    Your posting must be changed if you're to be correct

Posting Permissions

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



Click Here to Expand Forum to Full Width