Trim a String from the end of another String
static String rtrim(String s, String char) { while (s.endsWith(char)) { s = s.replaceFirst(char, "", s.lastIndexOf(char)); } return s; }