Finding uppercase characters within a string

I’m not too sure I follow, but you can strip using the replace method and regular expressions

var str="MaEfSdsfSsdfsAdfssdGsdfEsdf";
var newmsg = str.replace(/[a-z]/g, '');
var old = str.replace(/[A-Z]/g, '');

In this case, newmsg = ‘MESSAGE’.

Leave a Comment