If you want a string class that is thourougly tested, optimized and works pretty much like Javas String (or CString although I have never used MFC because I think it really sucks), then the STL string container is the answer.
STLport (
www.stlport.org) is a free available STL source library that works on practically any platform. Just make shure you disable the iostream support first. Info on how to do this can be found on
www.pocketfrog.com and on the PocketFrog forum here on PocketMatrix.