For smart Primates & ROBOTS (oh and ALIENS ).

Blogroll

Friday, November 07, 2014

replace all space in javascript

Problem:

How to replace all space in javascript?

Solution:

You will use "replace" method to replace in javascript

Example:


replace all spaces with "_" sign
use:
statename=statename.replace(/ /g, "_");

replace all occurance in javascript
replace all spaces with "abc" sign wirh "_"
use:

statename=statename.replace(/abc/g, "_");
Share:

0 comments:

Post a Comment

How to make center align child div

 How to make center align child div?   Suppose you have 2 Div tag. And want the make inner tag center <div id="d1">      ...

Ads Inside Post

Powered by Blogger.

Arsip

Blog Archive