Adds function to remove trailing white spaces