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

FindAndRemove() private method

find the given character and remove
private FindAndRemove ( string &sBodyStruct, char ch ) : bool
sBodyStruct string body structure
ch char first character to find and remove
return bool
        bool FindAndRemove(ref string sBodyStruct, char ch)
        {
            sBodyStruct = sBodyStruct.Trim();
            if (sBodyStruct[0] != ch)
            {
                string sLog = "Invalid Body Structure " + sBodyStruct + ".";
                Log(LogTypeEnum.ERROR, sLog);
                return false;
            }

            // remove character
            sBodyStruct = sBodyStruct.Substring(1);

            return true;
        }