Hi

Both of these methods do the same thing, but in different ways.  Would you
say one of these is more efficient?  And if so, why?

Thanks!

/*
** NextField
**
** Returns the next whole word from the text string
** and removes it from the passed in string.
*/
CString CSequentialEntity::NextField(CString &rStrText)
{
        CString strField;

        rStrText.TrimLeft();
        strField = rStrText.SpanExcluding( _T(" ") );
        rStrText = rStrText.Mid( strField.GetLength() );        

        return strField;
}

// Breaks off the next token (up to space).
// Trim passed in string.
CString CUpdatePublicTalksDlg::NextToken(CString &rStrText)
{
        int             i;
        CString strToken;

        // Extract token
        i = rStrText.Find( _T(" ") );
        if( i != -1 )
        {
                strToken = rStrText.Left( i );
                rStrText = rStrText.Mid( i + 1 );
        }
        else
        {
                strToken = rStrText;
                rStrText = _T("");
        }

        return strToken;
}

Andrew Truckle
CAD Manager
Atkins Survey and Mapping
Avon Way, Langley Park, Chippenham, Wiltshire. SN15 1GG
Telephone:     01249 455032
Switchboard:   01249 455000
Fax:             01249 455045
E-Mail: [EMAIL PROTECTED]
www.atkinsglobal.com


This email and any attached files are confidential and copyright protected.
If you are not the addressee, any dissemination of this communication is
strictly prohibited. Unless otherwise expressly agreed in writing, nothing
stated in this communication shall be legally binding.

_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for 
subscription changes, and list archive.

Reply via email to