Advertisement
triplex239

task 8 page 380

Oct 29th, 2020 (edited)
1,813
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.58 KB | None | 0 0
  1. class MyClass
  2.     {
  3.         static void Main()
  4.         {
  5.             TwoClass one = new TwoClass("супер классный текст");
  6.             Console.WriteLine(one);
  7.             one.Insert(5, "NIKE");
  8.             Console.WriteLine(one);
  9.         }
  10.     }
  11.     class TwoClass
  12.     {
  13.         public string Text;
  14.         public TwoClass(string txt)
  15.         { Text = txt; }
  16.         public void Insert(int n, string txt)
  17.         {
  18.             Text = Text.Insert(n, txt);
  19.         }
  20.         public override string ToString()
  21.         {
  22.             return Text;
  23.         }
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement