Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- }
- private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
- {
- }
- private void Button_Click(object sender, RoutedEventArgs e)
- {
- string s = this.shifer(tb.Text);
- tb2.Text = s;
- }
- private string shifer(string input)
- {
- string output = "";
- string buff,
- alfa = "абвгдеёжзийклмнопрстуфхцчшщъыьэюя",
- key = new string(alfa.ToCharArray().Reverse().ToArray());
- for (int i = 0; i < input.Length; i++)
- {
- if (!(input[i].Equals(' ') || input[i].Equals(',')) || input[i].Equals('.'))
- output += key[alfa.IndexOf(input[i])];
- else
- output += input[i];
- }
- return output;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement