Here you can find the source of rtrim(String string, String end)
public static String rtrim(String string, String end)
//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, ";"); } }