2 using System.Collections.Generic;
7 public static void Main()
10 MText mt = new MText (str), mt2;
12 Console.WriteLine (str + mt);
13 Console.WriteLine (mt + str);
14 Console.WriteLine (mt + 'a');
17 Console.WriteLine (mt2);
19 Console.WriteLine ("{0}, Length={1}", mt, mt.Length);
21 Console.WriteLine ("U+{0:X4}", c);
22 Console.WriteLine (mt + new MText ("漢字"));
23 Console.WriteLine (mt[2,4]);
24 mt[0] = '日'; // == mt.Del (0, 1); mt.Ins (0, char)
25 Console.WriteLine (mt);
26 mt[1,3] = new MText ('本'); // == mt.Del (1, 3); mt.Ins (1, mt)
27 Console.WriteLine (mt);
28 mt[1,2] = null; // == mt.Del (1, 2)
29 Console.WriteLine (mt);
30 // explicit casting (MText -> string)
31 string str2 = " " + (string) mt + (string) ((MText) "abc").Cat ('a');
32 Console.WriteLine (str2);
33 // implicit casting (string -> MText)
37 Console.WriteLine (mt2);