Guest User

Untitled

a guest
Jun 25th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. string str = "Hello gues!";
  2. Console.WriteLine(str);
  3. Console.WriteLine("nWhat we want to do with this string?");
  4. Console.WriteLine("nInsert - 0; nRemove - 1; nReaplace - 2; nContains - 3; nExit - 4;n"); // выбор действия со строкой.
  5.  
  6. int e = Convert.ToInt32(Console.ReadLine());
  7.  
  8. if (e == 0)
  9. {
  10. Console.WriteLine("Enter the number of latter: "); // место, в которое нужно вставить символы
  11. int i = Convert.ToInt32(Console.ReadLine());
  12. Console.WriteLine("Enter the letter , that we want to insert: "); // символ/ы который/ые вставляем
  13. string str1 = Console.ReadLine();
  14.  
  15. Console.WriteLine(str.Insert(i, "" + str1 + ""));
  16.  
  17. }
  18.  
  19. string str = "Hello gues!";
  20. Console.WriteLine(str);
  21. int e;
  22. do
  23. {
  24. Console.WriteLine("nWhat we want to do with this string?");
  25. Console.WriteLine("nInsert - 0; nRemove - 1; nReaplace - 2; nContains - 3; nExit - 4;n"); // выбор действия со строкой.
  26.  
  27. e = Convert.ToInt32(Console.ReadLine());
  28.  
  29. if (e == 0)
  30. {
  31. Console.WriteLine("Enter the position of latter: "); // место, в которое нужно вставить символы
  32. int i = Convert.ToInt32(Console.ReadLine());
  33. Console.WriteLine("Enter the letter , that we want to insert: "); // символ/ы который/ые вставляем
  34. string str1 = Console.ReadLine();
  35.  
  36. Console.WriteLine(str.Insert(i, "" + str1 + ""));
  37.  
  38. }
  39. } while (e != 4);
Add Comment
Please, Sign In to add comment