Im doing a caesar cipher and decipher, and i need to ignore this letters from the String: "á é ó í ú", cause we need to cipher text in spanish too, is there any function to ignore this letters or a way to change them in the cipher and still work in the decipher?
private char cipher(char ch, int key)
{
if (!char.IsLetter(ch))
{
return ch;
}
char d = char.IsUpper(ch) ? 'A' : 'a';
return (char)((((ch + key) - d) % 26) + d);
}
something i expect is, if i enter a String like : "wéts"
with a key an2, i get an output "uéiy"
and when i decipher the "uéiy"
i get "wéts"
again