c# - check for indented string -


i parsing .ini file , need target exact section. .ini file looks , trying target section "2nd section" , not continue on:

1st section     item1     item2     item3 2nd section     item1     item2     item3 3rd section     item1     item2     item3 

here code have far target section header "1st string"

    private static string parsesataheader(string sataheader, string bcufilename)     {         string strline = "";         streamreader myreader = new streamreader(bcufilename);         bool foundsection = false;          while (strline !=null)         {             strline = myreader.readline();             if (strline !=null)             {                if (string.compare("2nd section", strline, stringcomparison.ordinalignorecase) == 0)                     sataheader = strline.trim();             } 

in vbs know can regexpression function in order keep iterating until find string not indented. ideas?

have @ this ini parser written c#. believe if use parser instead of regex engine or string split etc.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -