Beispiel #1
0
        public static void Parse(this IINIKeyValuePair pThis, string fullValue)
        {
            if (string.IsNullOrWhiteSpace(fullValue))
            {
                pThis.IniKey   = "";
                pThis.IniValue = "";
                return;
            }

            int startIndex = fullValue.IndexOf('=');

            if (startIndex != -1)
            {
                pThis.IniKey   = fullValue.Substring(0, startIndex);
                pThis.IniValue = fullValue.Substring(startIndex + 1);
            }
            else
            {
                pThis.IniKey   = fullValue;
                pThis.IniValue = "";
            }
        }
Beispiel #2
0
 public static string ToFullValue(this IINIKeyValuePair pThis)
 {
     return(string.Format("{0}={1}", pThis.IniKey, pThis.IniValue));
 }