October 22, 2016
Hot Topics:

A Simple CString Tokenizer

  • March 3, 1999
  • By Richard Case
  • Send Email »
  • More Articles »

As the name suggests, this is a simple class to extract tokens from a CSting. I wrote this class becuase during the course of my final year project at University I needed a simple way to extract 'tokens' from a CString. This is what I came up with. Its probably not the best or most effeicent way to accomplish the task - but it works which in the main thing.

To use the CToken class:

-First include the CToken header file in your porgram:

#include "Token.h"

-Then you are free to create and use an instance of CToken. For example:

CString str = "A B C D"
CString newTok;
CToken tok(str);
tok.SetToken(" ");
   newTok = tok.GetToken()
If people can suggest any improvements or there bugs please drop me an email

Download demo project - 15 KB

Download source - 3 KB

Date Posted: March 3, 1999

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Sitemap | Contact Us

Thanks for your registration, follow us on our social networks to keep up-to-date
Rocket Fuel