lf.281专题

LF.281.Remove Spaces

Given a string, remove all leading/trailing/duplicated empty spaces.Assumptions:The given string is not null.Examples:“ a” --> “a”“ I love MTV ” --> “I love MTV” 1 public String removeSpaces