using System; using System.Collections.Specialized; namespace POP3Client { public class Person { protected mutable name : string; protected mutable mail : string; public this (personString : string) { if (personString == null) {} else { name = String.Empty; mail = String.Empty; mutable namePositionBegin = 0; mutable namePositionEnd = 0; mutable mailPositionBegin = 0; mutable mailPositionEnd = 0; if (namePositionBegin >= 0 && namePositionEnd > namePositionBegin) name = personString.Substring (namePositionBegin + 1, namePositionEnd - namePositionBegin - 1) else {}; if (mailPositionBegin >= 0 && mailPositionEnd > mailPositionBegin) mail = personString.Substring (mailPositionBegin + 1, mailPositionEnd - mailPositionBegin - 1) else {}; if (mail.Length == 0 && name.Length == 0) mail = personString else {}; } } public Name : string { get { name } } public Email : string { get { mail } } } }