Paka Information

jQuery Removing All Spaces From String

924 0

jQuery Removing All Spaces From String

Today, We want to share with you jQuery Removing All Spaces From String.
In this post we will show you Removing All Spaces From a String Using jQuery, hear for javascript remove all white space from string we will give you demo and example for implement.
In this post, we will learn about How to Remove White Spaces from A String Using jQuery with an example.

jQuery – Remove ALL white spaces from text Example

Often we require to all the string trim means remove all the space as white space from given any special text or string.

Also Read :  Search Engine Rankings TIPS AND TRICKS

->So at that time you can remove some spaces from Text using javascript function replace() of core php. as well as simple replace() will help to all the string replace your blank or white space as well as empty space or extra any space or trailing trim space from text or string that way we can delete/remove.

->you can do very Easy way, it from bellow Best example.

<html lang="en">
<head>
    <title>Jquery - Remove All white space from string Example - pakainfo.com</title>  
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
</head>
<body>

<div class="mycontent">
  This   is  my    pakainfo      site.
</div>

<script type="text/javascript">
      var myText = $(".mycontent").text();
      var remove_space = myText.replace(/ /g,'');
      alert(remove_space);
</script>
</body>
</html>

We hope you get an idea about jquery remove white space from beginning and end of string
We would like to have feedback on my Information blog .
Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

Also Read :  Top 10 Advanced PHP Interview Questions Answers

We hope This Post can help you…….Good Luck!.

Leave A Reply

Your email address will not be published.