Here we will write code for encryption of any given input to the different character.
Example: if user input a it will convert to e next 4 charactor
if user enter z it will convert to d
Suppose if user input abcxyz it will be converted to efgbcd
Below code snippet will do the same
var userInput = ReadLine().ToLower();
char[] array = new char[userInput.Length];
for (int i = 0; i < userInput.Length; i++)
{
var current = (int)userInput[i];
//97(a) to 122(z)
if (current > 96 && current < 119)
{
array[i] = (char)(current + 4);
}
else if (current > 118 && current < 123)
{
array[i] = (char)(current - 22);
}
}
Console.WriteLine(array);
Hello, I want to work in your company on a voluntary basis, can you offer me anything?
a little about me: https://about.me/iren
Thanks – Enjoyed this article, can you make it so I get an email sent to me when there is a new update?
I just couldn’t depart your site before suggesting that I extremely enjoyed the standard information a person provide for your visitors? Is gonna be back often in order to check up on new posts
Hey there! This is kind of off topic but I need some help from an established blog. Is it difficult to set up your own blog? I’m not very techincal but I can figure things out pretty quick. I’m thinking about creating my own but I’m not sure where to begin. Do you have any tips or suggestions? With thanks