Tell us what’s happening:
Describe your issue in detail here.
well I have pretty much solved it but I’m having issue in whitespaces and special characters. I wanted to apply regex only to capital letter but its removing specials characters and whitespaces
**Your code so far**
function rot13(str) {
function alpha(x){
return String(x).match(/^[A-Z]/g)
}
let string = '';
for(let i = 0; i <= str.length; i++){
let o = str.charCodeAt(i)
if(alpha(str[i])){
string += String.fromCharCode((o % 26) + 65);
}
}
return string
}
console.log(rot13("SERR CVMMN!"));
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.74 Safari/537.36
Challenge: Caesars Cipher
Link to the challenge: