ItSolutionStuff.com

JQuery Remove All Numbers from String Example

By Hardik Savani • November 17, 2022
jQuery

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...

Tags: jQuery
Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

How to Remove First Element from Array in JQuery?

Read Now →

Jquery Convert Object to String Example

Read Now →

HTML Tags are not Allowed in Textbox Validation using JQuery

Read Now →

Preview an image before Upload using jQuery Example

Read Now →

How to Check Image Loaded or Not in JQuery?

Read Now →

How to Check If Element is Exists or Not in jQuery?

Read Now →

How to Each Loop with Class Element in JQuery?

Read Now →

How to Remove Query String from URL using JQuery?

Read Now →

Automatically Scroll to Bottom of Div JQuery Example

Read Now →

Check and Uncheck All Checkbox using JQuery Example

Read Now →

How to Allow Only One Checkbox Checked at a Time in JQuery?

Read Now →

How to Convert Line Breaks to br in jQuery ?

Read Now →