replace and replaceAll methods | String Object In JavaScript

preview_player
Показать описание
🎁 Join my channel to get access to perks:

🧡 Hello All JavaScript Lovers Outhere!

Today you're going to learn about the String Object In JavaScript.

This tutorial is a series of videos, in each video we will discuss a method (or more) of the String Object in JavaScript.

In today's video, you're going to learn about the replace, and replaceAll methods.

The replace() method returns a new string with some or all matches of a pattern replaced by a replacement.

The replaceAll() method returns a new string with all matches of a pattern replaced by a replacement.

🔷 Syntax :
replace(regexp, newSubstr)
replaceAll(regexp, replacerFunction)

replace(substr, newSubstr)
replace(substr, replacerFunction)

🔷 Syntax :
replaceAll(regexp, newSubstr)
replaceAll(regexp, replacerFunction)

replaceAll(substr, newSubstr)
replaceAll(substr, replacerFunction)

🌍 Social Media Links.

💲 Suppport the Channel
Рекомендации по теме
Комментарии
Автор

🚨 Big Announcement! 🚨

Hey everyone! I've made a big decision for this channel—I've turned off ads on all my videos! That's right, you can now enjoy all my content ad-free! This means I'm earning $0 from ad revenue, but I believe this is the right move to make your viewing experience better.

If you find my content valuable and want to support my work, there are several ways you can help:

Like & Share: Simply liking the video and sharing it with friends helps a lot!
Subscribe & Hit the Bell: Stay updated and never miss a new video.
YouTube Thanks: Use the "Thanks" button below to send a one-time donation.
Join the Channel Community: Get exclusive perks and behind-the-scenes content.

Every little bit counts and goes directly to creating more high-quality content for you all. Thank you so much for your continued support!

Let’s keep growing and learning together! 🌟

CodeExplained
Автор

After reading a document in w3schools, I got stuck. But you saved me with a straightforward and perfect explanation. Thanks!

jathebest
Автор

Awesome explain can i take multiple regExp and replace all with changing value function?

everyDev-everyDay
Автор

for me .replace("aString", "anOtherString"); replaces all strings withing the String.

alexkemos
Автор

Sir please tell replace method Alternative

ramya