code: public static String rightTrim(final String aString) {
  		if (aString == null) {
  			return null;
  		}
  		int end = aString.length() - 1;
  		while ((end >= 0) && (aString.charAt(end) <= ' ')) {
  			end--;
  		}
  		if (end == aString.length() - 1) {
  			return aString;
  		}
  		return aString.substring(0, end + 1);
  	}
docs: Copies this String removing white space characters from the end of the string.
  
  @param aString the String to trim.
  @return a new String with characters <code>\\u0020</code> removed from the end