TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vignesh Kumar
NA
1k
415.9k
Split newline string using comma
Nov 20 2013 5:47 AM
Hi,
I need a javascript to split newline characters with commas. The below one, I am able to split white space and not the new line. Can anyone help me?
<html>
<head>
<script>
function convert() {
var data = document.getElementById("get").value;
var lines = data.split(' ');
document.getElementById("display").value = lines.join(',');
}
</script>
</head>
<body>
<div>
Enter Code:
</br>
<textarea id="get"> </textarea>
</br>
<input type="button" value='Convert' onclick="convert()"/>
</br>
<textarea id="display"> </textarea>
</div>
</body>
</html>
Reply
Answers (
2
)
update CSV File data in javascript
about IsPostback method