System.ZXParser.GetKeyString C# (CSharp) Method

GetKeyString() public static method

public static GetKeyString ( string s, List l, int li ) : string
s string
l List
li int
return string
        public static string GetKeyString(string s, List<DIndices> l, int li)
        {
            // This Is The End Point Of The Key
            int ei = l[li].Start - 2;
            int si = li > 0 ? l[li - 1].End + 2 : 0;

            // Move End Index Until No White Space Is Found
            while(ei > si && char.IsWhiteSpace(s[ei])) ei--;

            // All White Space Was Found
            if(si >= ei) return null;

            // Find The Beginning Of The Key
            int ksi = ei - 1;
            while(ksi >= si && !char.IsWhiteSpace(s[ksi])) ksi--;
            ksi++;

            int ls = ei - ksi + 1;
            return (ls < 1 || (ksi + ls) > s.Length) ? "" : s.Substring(ksi, ls);
        }