Using string.equals() and not getting the results...

what do you suggest I use instead of the += operator?

First thing I'd do is recommend is that you forget all about the String class, but I know that you won't.

So, the problem with the statement

TagID = TagID += buffer;

is that the size of TagID is determined, along with the size of buffer. The two sizes are added, and that much memory is allocated. The data that was in TagID is copied to the new memory, and the data that is in buffer is copied after it. The space that TagID was pointing to is deallocated, and TagID now points to the new memory location. That is, the TagID on the right of the equals sign does. You then assign this value to another variable that happens to be the same one. That doesn't matter, though. The copy constructor is called anyway, with more allocing and copying.

The TagID += buffer; part of that statement is all that is needed. It is the rest that is the real waste.