Joshi.Utils.Imap.Imap.ParseString C# (CSharp) Method

ParseString() private method

Parse the string (seperated by spaces or parenthesis)
private ParseString ( string &sBodyStruct, string &sString ) : bool
sBodyStruct string Body Struct
sString string string
return bool
        bool ParseString(ref string sBodyStruct, ref string sString)
        {
            sString = "";

            // remove any spaces at the beginning and the end
            sBodyStruct = sBodyStruct.Trim();
            // check if this is NIL
            if (IsNilString(ref sBodyStruct))
                return true;

            // extract the literal as whole looking for a
            // space or closing paranthesis character
            char ch;
            int nEnd, nLen;
            nLen = sBodyStruct.Length;

            for (nEnd = 0; nEnd < nLen; nEnd++)
            {
                ch = sBodyStruct[nEnd];

                if (ch == ' ' || ch == ')')
                    break;
            }

            if (nEnd > 0)
            {
                sString = sBodyStruct.Substring(0, nEnd);
                sBodyStruct = sBodyStruct.Substring( nEnd );
            }
            return true;
        }