How can i remove trailing blanks?

I have two source codes, older and newer version. I can easily find trailing blanks in the older version but was unable to remove them. So please tell me that is there any way to remove trailing blanks in Unix based operating system. If yes how can I do it?
