Trim spaces from end of Strings when edit details button is clicked