Here you can find the source of rightTrim(final String aString)
Parameter | Description |
---|---|
aString | the String to trim. |
\\u0020
removed from the end
public static String rightTrim(final String aString)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w . j ava2 s .c om*/ * 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 */ 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); } }