[Pydev-cvs] org.python.pydev.core/src/org/python/pydev/core/docutils StringUtils.java,1.2,1.3
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2006-03-22 01:42:06
|
Update of /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/docutils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24145/src/org/python/pydev/core/docutils Modified Files: StringUtils.java Log Message: Index: StringUtils.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/docutils/StringUtils.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StringUtils.java 5 Sep 2005 22:56:14 -0000 1.2 --- StringUtils.java 22 Mar 2006 01:41:59 -0000 1.3 *************** *** 46,48 **** --- 46,60 ---- return j; } + + public static String rightTrim(String input) { + int len = input.length(); + int st = 0; + int off = 0; + char[] val = input.toCharArray(); + + while ((st < len) && (val[off + len - 1] <= ' ')) { + len--; + } + return input.substring(0, len); + } } |