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

Image Zoom Hover Effect

 Image Zoom Hover Effect                                                                   Image zoom hover out effect                      ...

Ads Inside Post

Powered by Blogger.

Arsip

Blog Archive