字符加密变换
string Greeting="Hello World";
Console.WriteLine(Greeting);
for (int i=(int)'z';i>=(int)'a';i--)
{
char Old=(char)i;
char New=(char)(i+1);
Greeting=Greeting.Replace(Old,New);
}
for (char i='Z';i>='A';i--)
{
char Old=(char)i;
char New=(char)(i+1);
Greeting=Greeting.Replace(Old,New);
}
Console.WriteLine(Greeting);
//TransLate content
for (char i='b';i<'{';i++)
{
char Old=(char)i;
char New=(char)(i-1);
Greeting=Greeting.Replace(Old,New);
}
for (char i='B';i<'[';i++)
{
char Old=(char)i;
char New=(char)(i-1);
Greeting=Greeting.Replace(Old,New);
}
Console.WriteLine(Greeting);
}
Console.WriteLine(Greeting);
for (int i=(int)'z';i>=(int)'a';i--)
{
char Old=(char)i;
char New=(char)(i+1);
Greeting=Greeting.Replace(Old,New);
}
for (char i='Z';i>='A';i--)
{
char Old=(char)i;
char New=(char)(i+1);
Greeting=Greeting.Replace(Old,New);
}
Console.WriteLine(Greeting);
//TransLate content
for (char i='b';i<'{';i++)
{
char Old=(char)i;
char New=(char)(i-1);
Greeting=Greeting.Replace(Old,New);
}
for (char i='B';i<'[';i++)
{
char Old=(char)i;
char New=(char)(i-1);
Greeting=Greeting.Replace(Old,New);
}
Console.WriteLine(Greeting);
}