Java String Trim Right rightTrim(String s)

Here you can find the source of rightTrim(String s)

Description

right Trim

License

Open Source License

Declaration

public static String rightTrim(String s) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String rightTrim(String s) {
        int pos = s.length();
        while (--pos >= 0)
            if (!Character.isWhitespace(s.charAt(pos)))
                break;
        return s.substring(0, pos + 1);
    }/*from  www. jav  a  2 s  . co m*/
}

Related

  1. rightTrim(final String aString)
  2. rightTrim(final String input, final char charToTrim)
  3. rightTrim(String input, char charToTrim)
  4. rightTrim(String s, char c)
  5. rightTrim(String src)
  6. rightTrim(String str)
  7. rightTrim(String str)