I am trying to write a function that decryptes an encrypted message that has uppercase letters (showing its a new word) and lower case characters (which is the word itself).
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'.