Java String Trim Right rtrim(String string, String end)

Here you can find the source of rtrim(String string, String end)

Description

rtrim

License

Apache License

Declaration

public static String rtrim(String string, String end) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String rtrim(String string, String end) {
        if (string.endsWith(end)) {
            string = string.substring(0, string.length() - end.length());
        }//from   w  w  w  . j a  va 2s.com

        return string;
    }

    public static String rtrim(String string) {
        return rtrim(string, ";");
    }
}

Related

  1. rtrim(String str)
  2. rtrim(String str)
  3. rtrim(String str, String charList)
  4. rtrim(String str, String defaultValue)
  5. rtrim(String str, String suffixs)
  6. rtrim(String text, char c)
  7. rTrim(String value)
  8. rtrim(String value, int maxLength)
  9. rTrimObj(Object o)