Java String Trim Right rtrim(final String str, final char filler)

Here you can find the source of rtrim(final String str, final char filler)

Description

PErforms right trim

License

Open Source License

Parameter

Parameter Description
str a parameter
filler a parameter

Declaration

public static String rtrim(final String str, final char filler) 

Method Source Code

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

public class Main {
    /**/*ww  w.  j  a va2s .  co m*/
     * PErforms right trim
     * 
     * @param str
     * @param filler
     * @return
     */
    public static String rtrim(final String str, final char filler) {
        // TODO: performansi arttirilmali
        if (str == null)
            return null;
        for (int i = str.length() - 1; i >= 0; --i) {
            if (str.charAt(i) != filler)
                return str.substring(0, i + 1);
        }
        return "";
    }
}

Related

  1. rightTrimSize(String s)
  2. rightTrimSlashes(String s)
  3. rightTrimString(String originalString)
  4. rtrim(final String input)
  5. rtrim(final String str)
  6. rtrim(final String text)
  7. rTrim(final String value)
  8. rtrim(String input)
  9. rTrim(String orgStr, String delimiter)