How to remove all spaces from string in JQuery?

How to remove all spaces from string in JQuery?

In this post we will give you information about How to remove all spaces from string in JQuery?. Hear we will give you detail about How to remove all spaces from string in JQuery?And how to use it also give you demo for it if it is necessary.

In this post, I would like to share with you how to remove all white spaces or blank space from a string using jquery.

Actually, we may sometime require to delete all empty spaces from string in jquery javascript. we can easily remove all black space using jquery replace function.

Here i give you very small example with one rich textbox and add button bellow. You have to simple add string on rich text box then click on button it will remove all spaces from added string.

It’s very simple example and also i give you demo for this you can see bellow button. You are able to download code for remove spaces using jquery. So let’s see bellow example.

Index.php

Also see:How to remove comma from string in jquery with example ?

<html lang="en">

<head>

<title>How to remove all spaces from string in JQuery? - ItSolutionStuff.com</title>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>

</head>

<body>


<div>

<h1>How to remove all spaces from string in JQuery? - ItSolutionStuff.com</h1>

<textarea >

ItSolutionStuff.com have a collection of Example and Demo of IT.

</textarea>

<button>Remove White Space</button>

</div>


<script type="text/javascript">

$("button").click(function(){

myText = $(".content-text").val();

var remove_space = myText.replace(/ /g,'');

alert(remove_space);

});

</script>


</body>

</html>

You can also download code and check demo too.

I hope it can help you…

Hope this code and post will helped you for implement How to remove all spaces from string in JQuery?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

21  +    =  26

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US