Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace ConsoleApplication1
  6. {
  7. class Row
  8. {
  9. public byte line;
  10. public List<char> str;
  11.  
  12. public Row(IEnumerable<char> str)
  13. {
  14. this.str = str.ToList();
  15. }
  16.  
  17. public Row()
  18. {
  19. }
  20.  
  21. public int GetLenght()
  22. {
  23. return str.Count();
  24. }
  25.  
  26. public void Clear()
  27. {
  28. str.Clear();
  29. }
  30. }
  31.  
  32. internal class Program
  33. {
  34. public static void Main(string[] args)
  35. {
  36. var row = new Row("Всем привет эта новая рубрика МЦК-КТИТС".ToCharArray());
  37. //row.Clear();//для удаления
  38. Console.WriteLine($"Длина строки: {row.GetLenght()}");
  39. Console.ReadKey();
  40. ;
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement