My colleague Pavlo always in a hurry.
Next code is really what you need.
I supposed, that str is AnsiString, and it contains
something like this:
2:00:00 PM
//-------------------------------
for(int x = 1;x <= str.Length();x++)
if(str[x] == ':' ||
str[x] == ' ')
str.Delete(x,1);
//---------------------------------