Prabhdeep Singh has Published 197 Articles

How to return a new string with a specified number of copies of an existing string with JavaScript?

Prabhdeep Singh

Prabhdeep Singh

Updated on 07-Nov-2022 06:40:02

126 Views

In this tutorial, we will explore the methods by which we can repeat a string a certain number of times, again and again, to make a new string in JavaScript. There are many scenarios where we may want to make a new string which is just another string repeated ‘x’ ... Read More

How to replace string using JavaScript RegExp?

Prabhdeep Singh

Prabhdeep Singh

Updated on 07-Nov-2022 06:24:32

2K+ Views

In this tutorial, we will explore how we can replace a particular sub string in a string by using regular expressions in JavaScript. Sometimes we may want to replace a recurrent sub string in a string with something else. In such cases, regular expressions can be beneficial. Before using them ... Read More

How to replace all occurrences of a string in JavaScript?

Prabhdeep Singh

Prabhdeep Singh

Updated on 07-Nov-2022 06:20:23

11K+ Views

This tutorial will teach us how to replace all occurrences of a string in JavaScript which mean by the end of the tutorial we will learn to detect a given type of substring from the given string and replace it will another given string by the user. To replace all ... Read More

How to replace all dots in a string using JavaScript?

Prabhdeep Singh

Prabhdeep Singh

Updated on 07-Nov-2022 06:11:14

4K+ Views

In this tutorial, we will explore the different ways by which we can replace all dots in a string using JavaScript. It is possible to remove all occurrences of dots in a string manually by running a for loop, but JavaScript provides many functions by which we can accomplish the ... Read More

How to remove two parts of a string with JavaScript?

Prabhdeep Singh

Prabhdeep Singh

Updated on 07-Nov-2022 06:05:44

2K+ Views

This tutorial teaches us how to remove the text part between two parts of a string with JavaScript, basically, we are given two ends that can be a string or a character and we have to remove the string lying in between them. In this tutorial, we are going to ... Read More

How to remove options from a dropdown list with JavaScript?

Prabhdeep Singh

Prabhdeep Singh

Updated on 07-Nov-2022 06:01:56

10K+ Views

This tutorial teaches us how to remove the options from a dropdown list using JavaScript. Usually, this is not frequent that users get the option to remove any option from the dropdown list but this is possible if the option is provided by the programmer. If the programmer wants to ... Read More

How to remove leading zeros from a number in JavaScript?

Prabhdeep Singh

Prabhdeep Singh

Updated on 07-Nov-2022 05:56:16

18K+ Views

In this tutorial, we will explore how we can remove leading zeroes from any number in JavaScript. JavaScript removes leading zeroes from an integer variable automatically, but this is not the case when we consider strings in JavaScript. It is possible that a string in JavaScript which represents a numerical ... Read More

Advertisements