static void Main(string[] args) { myString a = new myString("Hello"); myString b = new myString(); Console.WriteLine(" владелец: " + a.infAboutCreator.name + " организация: " + a.infAboutCreator.organization + " дата и время создания: " + a.creationTime.time); for (int j = 0; j < a.Length; j++) { Console.WriteLine(a[j]); } Console.Write("Удалить последний элемент\n"); b = a.DeleteLastEl(); for (int j = 0; j < b.Length; j++) { Console.WriteLine(b[j]); } Console.Write("добавить к строке число \n"); b = a + 421; for (int j = 0; j < b.Length; j++) { Console.WriteLine(b[j]); } Console.Write("сравнить строки\n"); if (a.Compare(b) == -1 && a < b) { Console.WriteLine('<'); } else if (a.Compare(b) == 0 && a == b) { Console.WriteLine('='); } else { Console.WriteLine('>'); } Console.Write("заменить всё введенным символом\n"); b = a * '!'; for (int j = 0; j < b.Length; j++) { Console.WriteLine(b[j]); } b[0] = a[0]; Console.Write("содержатся ли символы?\n"); if (a.CheckForSymbols("abc!")) { Console.WriteLine(true); } else { Console.WriteLine(false); } Console.Write("строка с запятой\n"); a = a + 123456; a[3] = ','; for (int j = 0; j < a.Length; j++) { Console.WriteLine(a[j]); } Console.Write("удалили знаки препинания\n"); a.DeletePunctuationMarks(); for (int j = 0; j < a.Length; j++) { Console.WriteLine(a[j]); } Console.Write("объединили строки\n"); a.Concat(b); for (int j = 0; j < a.Length; j++) { Console.WriteLine(a[j]); } }
static void Main(string[] args) { myString a = new myString("Hello"); myString b = new myString(); for (int j = 0; j < a.Length; j++) { Console.WriteLine(a[j]); } Console.Write("----------------------------------------------------------------------------------------------------------\n"); b = a.DeleteLastEl(); for (int j = 0; j < b.Length; j++) { Console.WriteLine(b[j]); } Console.Write("----------------------------------------------------------------------------------------------------------\n"); b = a + 421; for (int j = 0; j < b.Length; j++) { Console.WriteLine(b[j]); } Console.Write("----------------------------------------------------------------------------------------------------------\n"); if (a.Compare(b) == -1 && a < b) { Console.WriteLine('<'); } else if (a.Compare(b) == 0 && a == b) { Console.WriteLine('='); } else { Console.WriteLine('>'); } Console.Write("----------------------------------------------------------------------------------------------------------\n"); b = a * '!'; for (int j = 0; j < b.Length; j++) { Console.WriteLine(b[j]); } b[0] = a[0]; Console.Write("----------------------------------------------------------------------------------------------------------\n"); if (a.CheckForSymbols("abc!")) { Console.WriteLine(true); } else { Console.WriteLine(false); } Console.Write("----------------------------------------------------------------------------------------------------------\n"); a = a + 123456; a[3] = ','; for (int j = 0; j < a.Length; j++) { Console.WriteLine(a[j]); } Console.Write("----------------------------------------------------------------------------------------------------------\n"); a.DeletePunctuationMarks(); for (int j = 0; j < a.Length; j++) { Console.WriteLine(a[j]); } Console.Write("----------------------------------------------------------------------------------------------------------\n"); a.Concat(b); for (int j = 0; j < a.Length; j++) { Console.WriteLine(a[j]); } }