Truncate function takes a string and truncates it on the right removing all spaces (string.h does not have a special truncation function). Truncate is doing what rtrim performs in VB.