Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8078475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:48:29+00:00 2026-06-05T15:48:29+00:00

I have not had to do something like this in the past and am

  • 0

I have not had to do something like this in the past and am wondering if it is indeed possible. I am allowing multiple code numbers to be added in an so long as they are delimited by commas. What I am wanting to do is upon the user clicking on the “okay” button that a showing the numbers entered will show them one on top of each other with a “delete” button next to them. That part is easy…the hard part is getting the comma stripped out and the new line placed in its stead.

Are there any examples or samples that anyone can point me too?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:48:32+00:00Added an answer on June 5, 2026 at 3:48 pm

    You’d use String#replace with a regular expression using the g flag (“global”) for the “search” part, and a replacement string of your choosing (from your question, I’m not sure whether you want <br> — e.g., an HTML line break — or \n which really is a newline [but remember newlines are treated like spaces in HTML]). E.g.:

    var numbers = "1,2,3,4,5,6";
    numbers = numbers.replace(/,/g, '<br>'); // Or \n, depending on your needs
    

    Or if you want to allow for spaces, you’d put optional spaces either side of the comma in the regex:

    var numbers = "1,2,3,4,5,6";
    numbers = numbers.replace(/ *, */g, '<br>'); // Or \n, depending on your needs
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working at this for two days and have not had much luck.
Possible Duplicate: How to catch exceptions I have not really had to use try
I'm trying to define a new type and have not had much luck finding
I have found some similar Que's on SO but had not find the solution.
I have had the following problem for a while and I am really not
Sorry guys, not being lazy, I know others have had the same error message
I have not started creating the code so I don't have anything to show,
I just offered to work on this project from someone else, and have not
I had to change on my lines of code around. I before had something
I have two tables, for simplicity lets pretend they're defined like this Stack {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.