Пример #1
0
        public void RetrieveInfo(string fname, string lname, string mno, string date)
        {
            ////this is sentance for given requirements
            string message = "Hello <<name>>, We have your full name as <<full name>> in our system your contact number is <<91-xxxxxxxxx>>, Please,let us know in case of any clarification Thank you BridgeLabz <<dd/mm/yyyy>>.";
            //// give string to change the position of names
            string patternForName = "<<name>>";

            ////using showmatch static method of regularexexpression class to replace the pattern with valid data
            message = RegularExpresstion.ShowMatch(message, fname, patternForName);
            ////Pattern for changing full name from the sentence
            string patternForfame = "<<full name>>";

            ////using showmatch static method of regularexexpression class to replace the pattern with valid data
            message = RegularExpresstion.ShowMatch(message, fname + " " + lname, patternForfame);
            ////Pattern for changing mobile number from the sentence
            string contactNumber = "<<91-xxxxxxxxx>>";

            ////using showmatch static method of regularexexpression class to replace the pattern with valid data
            message = RegularExpresstion.ShowMatch(message, "91" + " " + mno, contactNumber);
            ////Pattern for changing Currrent date from the sentence
            string   Currentdate = "<<dd/mm/yyyy>>";
            DateTime today       = DateTime.Today;

            ////using showmatch static method of regularexexpression class to replace the pattern with valid data
            message = RegularExpresstion.ShowMatch(message, today.ToString(), Currentdate);
            Console.WriteLine(message);
        }
Пример #2
0
        static void Main(string[] args)
        {
            char flag;

            do
            {
                Console.WriteLine("PRESS: 1 TO JSON INVENTORY DATA MANAGAMENT");
                Console.WriteLine("PRESS: 2 TO REGULAR EXPRESSION");
                Console.WriteLine("PRESS: 3 TO STOCK OF COMPANY");
                Console.WriteLine("PRESS: 4 TO INVENTORY MANAGAMENTS");
                Console.WriteLine("PRESS: 5 TO DECKOFCARD");
                Console.WriteLine("PRESS 6 TO ADDRESSBOOK");
                Console.WriteLine("PRESS 7 FOR CARDQUEUE");
                Console.WriteLine("PRESS 8 FOR COMMERCIAL DATA PROCESSING");

                int n = Convert.ToInt32(Console.ReadLine());
                switch (n)
                {
                case 1:
                    Inventory inve = new Inventory();
                    inve.PrintTotalData();
                    break;

                case 2:
                    RegularExpresstion rx = new RegularExpresstion();
                    rx.Operation();
                    break;

                case 3:
                    StockOfsShare stockshare = new StockOfsShare();
                    stockshare.StockShare();
                    break;

                case 4:
                    InventoryManagement inmanage = new InventoryManagement();
                    inmanage.Management();
                    break;

                case 5:
                    DeckOfCard dc = new DeckOfCard();
                    dc.DeckCard();
                    break;

                case 6:
                    AddressBook addbook = new AddressBook();
                    addbook.AddressBookDetails();
                    break;

                case 7:
                    CardQueue cq = new CardQueue();
                    cq.CardInQueue();
                    break;
                }
                Console.WriteLine("ENTER YES FOR Y AND NO FOR N");
                flag = Convert.ToChar(Console.ReadLine());
            } while (flag == 'y' || flag == 'Y');
        }