Java String Trim Right rtrim(final String input)

Here you can find the source of rtrim(final String input)

Description

rtrim

License

Open Source License

Declaration

public static String rtrim(final String input) 

Method Source Code

//package com.java2s;

public class Main {
    public static String rtrim(final String input) {
        if (input == null)
            return null;
        if (input.isEmpty())
            return input;
        int i = input.length() - 1;
        while (i >= 0 && input.charAt(i) == ' ')
            --i;/*from   www  .j a  v a 2s .c  o  m*/
        return input.substring(0, i + 1);
    }
}

Related

  1. rightTrim(StringBuilder pStringBuilder)
  2. rightTrimNewLineChars(String input)
  3. rightTrimSize(String s)
  4. rightTrimSlashes(String s)
  5. rightTrimString(String originalString)
  6. rtrim(final String str)
  7. rtrim(final String str, final char filler)
  8. rtrim(final String text)
  9. rTrim(final String value)