How to Remove All Spaces from String in JQuery?
In this post, I would like to share with you how to remove all white spaces or blank space from a string using jquery.
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.
<title>How to remove all spaces from string in JQuery? - ItSolutionStuff.com</title>
<h1>How to remove all spaces from string in JQuery? - ItSolutionStuff.com</h1>
ItSolutionStuff.com have a collection of Example and Demo of IT.
<button>Remove White Space</button>
myText = $(".content-text").val();
var remove_space = myText.replace(/ /g,'');
You can also download code and check demo too.
I hope it can help you...
We are Recommending you
- How to Get Selected Radio Button Value in JQuery?
- JQuery Redirect to Another Page After 5 Seconds Example
- How to Check If Key Exists in JSON Object using JQuery?
- How to Get Selected Checkbox Value from Checkboxlist using JQuery?
- JQuery - How to Push Specific Key and Value in Array?
- How to Call AngularJS Controller Function in JQuery?
- How to Remove Comma from String in JQuery?
- How to Remove All Whitespace from String in JQuery?
- JQuery Delete Confirm Modal using Bootbox Example
- How to Remove Query String from URL using JQuery?
- Check and Uncheck All Checkbox using JQuery Example
- How to Allow Only One Checkbox Checked at a Time in JQuery?
- How to Check Undefined, Empty and Null in JQuery?
- How to Convert Line Breaks to br in jQuery ?
- How to Check Object is Empty or Not in JQuery?