Java String Trim Right rightTrim(String value)

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

Description

right Trim

License

Open Source License

Declaration

private static String rightTrim(String value) 

Method Source Code

//package com.java2s;

public class Main {

    private static String rightTrim(String value) {
        if (value == null) {
            return "";
        }//from w  ww.j  a v a 2 s  . c  om
        int length = value.length();
        for (int i = length - 1; i >= 0; i--) {
            if (value.charAt(i) != 0x20) {
                break;
            }
            length--;
        }
        return value.substring(0, length);
    }
}

Related

  1. rightTrim(String src)
  2. rightTrim(String str)
  3. rightTrim(String str)
  4. rightTrim(String str)
  5. rightTrim(String string)
  6. rightTrim(String[] values)
  7. rightTrim(StringBuilder pStringBuilder)
  8. rightTrimNewLineChars(String input)
  9. rightTrimSize(String s)