JQuery Remove All Numbers from String Example
Hello Folks,
In this quick example, let's see jquery remove all numbers from string. you can understand a concept of how to remove all numbers from a string in jquery. you'll learn jquery remove all numbers from string. This article goes in detailed on jquery string remove all numbers.
I will give you a very simple and short example of how to remove all numbers from string in jquery. we will use replace function to remove all numbers from text. so, let's run the below html file.
Example:
index.html
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
</head>
<body>
</body>
<script type="text/javascript">
$(document).ready(function () {
myString = "Hi, It 123 SolutionStuff 456";
newString = myString.replace(/\d+/g, '');
console.log(newString);
});
</script>
</html>
Output:
Hi, It SolutionStuff
I hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- How to Remove First Element from Array in JQuery?
- Jquery Convert Object to String Example
- HTML Tags are not Allowed in Textbox Validation using JQuery
- Preview an image before Upload using jQuery Example
- How to Check Image Loaded or Not in JQuery?
- How to Check If Element is Exists or Not in jQuery?
- How to Each Loop with Class Element in JQuery?
- How to Remove Query String from URL using JQuery?
- Automatically Scroll to Bottom of Div JQuery Example
- Check and Uncheck All Checkbox using JQuery Example
- How to Allow Only One Checkbox Checked at a Time in JQuery?
- How to Convert Line Breaks to br in jQuery ?