Remove commas from string – Javascript

code image

Let’s look at how you can achieve that!

Well to be honest there isn’t much to it we will just use replaceAll.

const str = 'R,e,a,c,t, > ,A,n,g,u,l,a,r'

const noCommas = str.replaceAll(',', '')
// noCommas = React > Angular

And there you go, could not be easier!

Leave a Comment

Your email address will not be published. Required fields are marked *