suhas setty

suhas setty

  • NA
  • 128
  • 52.1k

select text from two string values using regex

Jun 20 2013 7:42 AM
file name : example.txt
inside text file
33.0.123
loading "apple\folder1\folder2"
loading "bat\folder3\folder4"
unloaded "cat\fold5\fold6"
 
33.0.122
loading "apple\folder1\folder2"
loading "bat\folder3\folder4"
unloaded "cat\fold5\fold6"
 
33.0.121
loading "apple\folder1\folder2"
loading "bat\folder3\folder4"
unloaded "cat\fold5\fold6"

            var el = str.XPathSelectElement("//version/major").Value;
            var el1 = str.XPathSelectElement("//version/minor").Value;
            var el2 = str.XPathSelectElement("//version/build").Value;



            Console.WriteLine("{0}.{1}.{2}", el, el1, el2);
            string output = string.Format("{0}.{1}.{2}", el, el1, el2);

            string result = (Convert.ToInt32(el2) - 1).ToString("D3");
          
            string output1 = string.Format("{0}.{1}.{2}", el, el1, result);
            Console.WriteLine(output1);

here in string output = 33.0.123;
and string output1 = 33.0.122; is stored, by taking string values ,i want to select loading part using regex
 

Answers (1)