Here you can find the source of rTrim(String s)
Parameter | Description |
---|---|
s | a parameter |
public static String rTrim(String s)
//package com.java2s; public class Main { /**//from w ww.j a v a 2 s . c om * Purpose: * <br> * rTrim<br> * <br> * @param s * @return<br> */ public static String rTrim(String s) { int i = s.length() - 1; while (i >= 0 && Character.isWhitespace(s.charAt(i))) { i--; } return s.substring(0, i + 1); } }