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

Add Dependent Scripts

   here is the code that allow to add dependent script :         <script>         const addDependentScripts = async function( scriptsT...

Ads Inside Post

Powered by Blogger.

Arsip