zadanie2.cs 765 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace prakt_1_klassi
  7. {
  8. internal class zadanie2
  9. {
  10. public static string text;
  11. public static void udalenie(int ind)
  12. {
  13. try
  14. {
  15. char[] chars = text.ToCharArray();
  16. text = Convert.ToString(chars[0]);
  17. for (int i = 1; i < ind + 1; i++)
  18. {
  19. text = text + chars[i];
  20. }
  21. Console.WriteLine(text);
  22. }
  23. catch (Exception ex)
  24. {
  25. Console.WriteLine(ex.Message);
  26. Console.WriteLine(ex.StackTrace);
  27. }
  28. }
  29. }
  30. }