Advertisement
Guest User

Untitled

a guest
Dec 12th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. public partial class MainWindow : Window
  2. {
  3. public MainWindow()
  4. {
  5. InitializeComponent();
  6. }
  7.  
  8. private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
  9. {
  10.  
  11. }
  12.  
  13. private void Button_Click(object sender, RoutedEventArgs e)
  14. {
  15. string s = this.shifer(tb.Text);
  16. tb2.Text = s;
  17. }
  18.  
  19. private string shifer(string input)
  20. {
  21. string output = "";
  22.  
  23. string buff,
  24. alfa = "абвгдеёжзийклмнопрстуфхцчшщъыьэюя",
  25. key = new string(alfa.ToCharArray().Reverse().ToArray());
  26.  
  27. for (int i = 0; i < input.Length; i++)
  28. {
  29. if (!(input[i].Equals(' ') || input[i].Equals(',')) || input[i].Equals('.'))
  30. output += key[alfa.IndexOf(input[i])];
  31. else
  32. output += input[i];
  33. }
  34.  
  35. return output;
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement