Greenway Health Interview Question

How would you trim off trailing white spaces?